Opened 10 years ago
Last modified 8 years ago
#8934 open bug
Spinner: Percentage functionality fails
Reported by: | kvdeede | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.spinner | Version: | 1.9.2 |
Keywords: | globalize | Cc: | |
Blocked by: | Blocking: |
Description
The spinner percentage functionality fails. From 0% it goes to 1% to 100% and afterwards it is impossible to go back to 0. When no maximum is set, it goes from 100% to 10.000% and it stays impossible to go back to a lower number. I made a jsFiddle project here: http://jsfiddle.net/7J8vs/
I checked and have exactly the same problem on jsFiddle as I have on my local project.
Change History (6)
comment:1 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | Percentage functionality spinner fails → Spinner: Percentage functionality fails |
comment:2 Changed 10 years ago by
This seems to be due the step value being coerced into a number before it is passed into Globalize.
For example if you want to use a step
of '1%'
:
Globalize.format('1%', 'p', 'en-US')
returns '1%'. However, by the time Globalize.format
is invoked the step
option is now a number, and Globalize.format(1, 'p', 'en-US')
returns '100.00 %'
.
comment:3 Changed 10 years ago by
Note that a similar thing happens when you use a step of 0.01. It goes from 0% to 1% to 101% to 10,000%.
comment:4 Changed 10 years ago by
Globalize.parseFloat
is used to store the value of the step option when the spinner is created.
Globalize.parseFloat('1%', 10, 'en-US')
=> 1
Then when a step is done Globalize.format
is used to determine what to display.
Globalize.format(1, 'p', 'en-US')
=> '100.00 %'
comment:5 Changed 10 years ago by
Milestone: | 1.10.0 → none |
---|
comment:6 Changed 8 years ago by
Keywords: | globalize added |
---|
Verified - http://jsfiddle.net/tj_vantoll/FrcFS/. I tried one with the US culture to make sure this wasn't just an issue with the culture file as well.