Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add Support for Floating Point Number Field #523

Closed
LucasNeuhausDev opened this issue Mar 3, 2023 · 4 comments
Closed

Enhancement: Add Support for Floating Point Number Field #523

LucasNeuhausDev opened this issue Mar 3, 2023 · 4 comments

Comments

@LucasNeuhausDev
Copy link

I am currently working on a project where I need to store geolocations in my .mdx files as lat and lng fields.
Because lat and lng coordinates are floating point numbers and can be negative, the current number field type does not work.

I would love to either add a separate float field type or allow a numberFormat or similar field that allows to specify what number type is expected.

Expressing these as a string and then parsing them works, but is not ideal.

I think this would not only be beneficial for my use case but for a lot more.

@LucasNeuhausDev LucasNeuhausDev added the enhancement New feature or request label Mar 3, 2023
@estruyf
Copy link
Owner

estruyf commented Mar 4, 2023

Thanks @LucasNeuhausDev for the suggestion.

@estruyf
Copy link
Owner

estruyf commented Mar 4, 2023

To have better number field support, there will be a new numberOptions setting coming which you can use in combination with your number field.

Here is an example:

{
  "title": "Float field",
  "name": "float",
  "type": "number",
  "numberOptions": {
    "isDecimal": true,
    "min": 0,
    "max": 100,
    "step": 0.01
  }
}

This way, you are able to specify more than only if it is a decimal value. You'll also be able to set the min, max, and step value.

estruyf added a commit that referenced this issue Mar 4, 2023
@estruyf
Copy link
Owner

estruyf commented Mar 4, 2023

You'll be able to test it out in the latest BETA version.

@LucasNeuhausDev
Copy link
Author

Exactly what I was looking for ♡.

I came across the project via the livestream from you and James Q Quick and added it to my side project while watching the Stream.
Just AMAZING work!
Exactly what I needed without looking for it 😃

I will check out the Beta!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants