String.format("%1$02d:%2$02d", m, s);
values ,m=0, s=11 --> .0:11
expected result : 00:11
Actual result from android for Arabic Language : .0:11
Analysis :
The android external\icu4c
for locale based number pattern ,It just replacing the zeroDigit()
for padding values only ,the input values(m,n) remain same as US
locale
for arabic decimalPatternChars are below
DecimalFormatSymbols- >localeData.decimalPatternChars:
٠#٫٬؛٪؉ا٫-
from above pattern the zeroDigit is \0660 (Arabic 0 digit)
So the output comes as mixed of the arabic & US digits -> .0:11
Is it a bug in Android?!
On Sep 7, 1:18 am, greg <[email protected]> wrote:
> Did you want the 1$ and 2$ inside the field width specifications?
>
> On Sep 6, 3:27 am, GPU <[email protected]> wrote:
>
> > Hi ,
> > passing two int values m =0 & s = 11, to below function
> > String formatted = String.format("%1$02d:%2$02d", m, s);
>
> > returning the value like .0:11 ,What could be the problem ?
>
> > m=0, s=11 --> .0:11
> > m=0, s=1 --> .0:.1
>
> > The 0 added to format the string always coming as '.' (dot).
>
> > Can anyone know ,from where the number patterns are getting loaded in
> > Android ?
>
> > I gone thorough the code ,Its related the following file ,
> > android\dalvik\libcore\icu\src\main\java\com\ibm\icu4jni\util
> > \Resources.java ->localeData.numberPattern
>
> > How the pattern for particular locale is loaded ,what could be the
> > problem for the above problem?
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en