Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Issues
  • #740
Closed
Open
Issue created Jan 21, 2017 by Administrator@rootContributor

Interest in possible new Field::Float component

Created by: javierjulio

I have a project with coordinates for tons of locations and their precision matters but it also varies (e.g. some are 4 decimals some are 6). Administrate works fine detecting that I have a float field (Postgres) and uses Field::Number. But the problem is it sets decimals: 2 and if you remove it, it uses a default of 0 so you lose all decimals. I figured this is fine for most numbers but not all the time yet I have no way around it. Since I have data that varies in precision its very important to see its exact value and not round it up or down. I did try using Field::String but then that causes search to fail.

I'd be happy to contribute a PR if there is interest in accepting a new Field::Float or something like that, where it has inherits or uses the same functionality of Field::Number but without the default of 0 for the decimals option. Would that be of interest?

Assignee
Assign to
Time tracking