1. wilmetteharbor1938
  2. Support
  3. Friday, March 16 2018, 10:04 PM
I've created a number field and want to allow a user to be able to enter a decimal (ie: 99.99). I've tried several ways of entering a value in the Step field (0.01, 2, 9.99, 99, any) but nothing I've tried allows a user to enter a decimal.
admin Accepted Answer
Admin
Numeric field type allow only to use integer (this is equal to input[type=number] in HTML5).

To make this the best way is to use text field type and set parameter "Format Allowed" to Decimal (see screenshot)
Attachments (1)
  1. more than a month ago
  2. Support
  3. # 1
wilmetteharbor1938 Accepted Answer
I saw that in the text field option. Would it make sense to make it available in the number field as well? Or what do you see the number field actually being used for?
  1. more than a month ago
  2. Support
  3. # 2
wilmetteharbor1938 Accepted Answer
Is there a way to switch a field type once it's created—such as from Number to Text?
  1. more than a month ago
  2. Support
  3. # 3
admin Accepted Answer
Admin
No sorry, each field have a own DB structure.
  1. more than a month ago
  2. Support
  3. # 4
wilmetteharbor1938 Accepted Answer
When using Number on a text field, what does STEP control then?
  1. more than a month ago
  2. Support
  3. # 5
wilmetteharbor1938 Accepted Answer
[*] To make this the best way is to use text field type and set parameter "Format Allowed" to Decimal (see screenshot)

I tried this and get the error 'Invalid Field'
  1. more than a month ago
  2. Support
  3. # 6
admin Accepted Answer
Admin
Hi,
When using Number on a text field, what does STEP control then?
In according with Number HTML5 the step attribute allow you to choose increment when you use +/- buttons, see screenshot 1

docs at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

To make this the best way is to use text field type and set parameter "Format Allowed" to Decimal (see screenshot)
Missing Screenshot, anyway "Decimal" use regular expression like "[0-9]+[,]*[0-9]*" (so it uses "," as separator between integer and decimal numbers). If you want use "." char then you can fill details like screenshot 2
Attachments (2)
  1. more than a month ago
  2. Support
  3. # 7
wilmetteharbor1938 Accepted Answer
Thank you—it works.
  1. more than a month ago
  2. Support
  3. # 8
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.