Search and Top Navigation
#8934 open bug ()
Opened December 26, 2012 08:50AM UTC
Last modified August 20, 2014 01:15PM UTC
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:
I checked and have exactly the same problem on jsFiddle as I have on my local project.
Attachments (0)
Change History (6)
Changed December 26, 2012 01:40PM UTC by comment:1
status: | new → open |
---|---|
summary: | Percentage functionality spinner fails → Spinner: Percentage functionality fails |
Changed December 26, 2012 02:42PM UTC by comment:2
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
stepof
'1%':
Globalize.format('1%', 'p', 'en-US')returns '1%'. However, by the time
Globalize.formatis invoked the
stepoption is now a number, and
Globalize.format(1, 'p', 'en-US')returns
'100.00 %'.
Changed December 26, 2012 02:47PM UTC by comment:3
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%.
Changed December 27, 2012 02:25AM UTC by comment:4
Globalize.parseFloatis 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.formatis used to determine what to display.
Globalize.format(1, 'p', 'en-US')=> '100.00 %'
Changed January 25, 2013 09:23PM UTC by comment:5
milestone: | 1.10.0 → none |
---|
Changed August 20, 2014 01:15PM UTC by comment:6
keywords: | → globalize |
---|
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.