flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Mclean (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (FLEX-27855) NumericStepper steps incorrectly with decimal values in European locale
Date Wed, 01 May 2013 23:46:15 GMT

     [ https://issues.apache.org/jira/browse/FLEX-27855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Justin Mclean reassigned FLEX-27855:
------------------------------------

    Assignee: Justin Mclean
    
> NumericStepper steps incorrectly with decimal values in European locale
> -----------------------------------------------------------------------
>
>                 Key: FLEX-27855
>                 URL: https://issues.apache.org/jira/browse/FLEX-27855
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: NumericStepper
>    Affects Versions: Adobe Flex SDK 4.5.1 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows 7
> Language Found: Spanish
>            Reporter: Adobe JIRA
>            Assignee: Justin Mclean
>              Labels: easyfix, easytest
>
>       Steps to reproduce:
> 1. Change OS locale to Spanish
> 2. Run this code:
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
>                      xmlns:s="library://ns.adobe.com/flex/spark" 
>                      xmlns:mx="library://ns.adobe.com/flex/mx"
>                      minWidth="955" minHeight="600">
>             <s:NumericStepper maximum="50" snapInterval="0.05" stepSize="0.05"/>
> </s:Application>
> 3. Click on up arrow to "step"
>  
>  Actual Results: sequence 0, 0.05, 5.05, 50 results.
>  
>  
>  Expected Results: sequence 0, 0,05, 0,1, 0,15, 0,2... results
>  
>  
> Notes: This is evidently a locale-related issue. The stepper is "reading" its text box
in a locale-sensitive fashion, interpreting comma as a decimal seperator and period as a thousands
separator. However it is "writing" its text box in a US fashion, ignoring the current locale,
interpreting comma as thousands seperator and period as decimal. This causes the strange stepping
results.
> Note that I tried forcing the locale to en_US using the locale style on the NumericStepper
but this is ignored - it continues using my spanish OS locale. Additionally, the following
code should work around the issue but in fact it has no effect:
> <fx:Declarations>
> 	<s:NumberFormatter id="formatter" decimalSeparator=","/>
> </fx:Declarations>
> <fx:Script>
> 	<![CDATA[
> 		public function parseIt(value:String):Number {
> 			return formatter.parse(value).value;
> 		}
> 		public function formatIt(value:Number):String {
> 			return formatter.format(value);
> 		}
> 	]]
>       >
> </fx:Script>
> <s:NumericStepper maximum="50" snapInterval="0.05" stepSize="0.05" valueFormatFunction="formatIt"
> 				  valueParseFunction="parseIt"/>
>     

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message