Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

I can't type commas in an numeric entry binded to a decimal value

FranciscoGGFranciscoGG ESMember ✭✭
edited July 2015 in Xamarin.Forms

This is really really strange.

I have an entry binded to a ´decimal´ value with a default value (which comes from server):

    <Entry Text="{Binding AmountToPay}" Keyboard="Numeric" />

And I see the value correctly, but if I remove the value and I try to type a different value, I can't introduce a comma. For example, I can't introduce 12,25, but I can introduce 12.

Do somebody know what is happening?

Tagged:

Best Answer

Answers

  • JacobPoulsen_JacobPoulsen_ DKMember ✭✭✭

    Hi @FranciscoGG , did you ever resolve this issue?

  • FranciscoGGFranciscoGG ESMember ✭✭

    @Jacob_b , I didn't.

    I had to bind to an string and then parse to decimal manually...

  • TorbenKruseTorbenKruse DEMember ✭✭✭
    edited October 2015

    @FranciscoGG @Jacob_b

    You having this issue on iOS or Android?

    Can you type dots(.)?

  • JacobPoulsen_JacobPoulsen_ DKMember ✭✭✭

    Hi @TorbenKruse on iPhone I can only type commas (which is fine) when using numeric Keyboard.

    On Android the keyboard shows buttons like "." "," "_" "-" but only "."(dot) works, AND can only be used once, so i can type 2.88, but not 2.888.88 (which should be 2.888,88) at least where i live :)

    problem with using 2.88, is that i convert it to a long Type, and that causes the number to be 288,00.. and not 2,88.. So yeah, it gets confusing pretty fast since i also support English language in my app, and i know they use dots and commas differently then I would where I live.

    So maybe.. its working as expected? I really can't tell..

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    there are some news about this problem on Android?

  • FranciscoGGFranciscoGG ESMember ✭✭

    @AlessandroCaliaro anything...I had to bind to a string variable, and then convert to a decimal.

  • Will.ItraxWill.Itrax CAMember ✭✭✭

    I had the same with decimals. I had to type 25 first and then insert a period to get 2.5.
    here is a link that indicated there is a bug that affects decimals.
    (http://bugzilla.xamarin.com/show_bug.cgi?id=32871)
    I suspect it also affects commas - at least they do not work for me when I bind to a double.

  • I'm resurrecting this thread as I'm having the same issue. Adding the DigitsKeyListener does help by letting you type the comma, but still it won't be shown in the Entry text field. Is there any workaround?

  • batmacibatmaci DEMember ✭✭✭✭✭

    @ValerioSantinelli said:
    I'm resurrecting this thread as I'm having the same issue. Adding the DigitsKeyListener does help by letting you type the comma, but still it won't be shown in the Entry text field. Is there any workaround?

    because it looks solution provided doesn't work. it only visually override dot on the keyboard with comma. but if you are overriding app culture correctly, it still enters dot, not comma. So this solution is senseless, it only overrides keyboard skin, not functionality

Sign In or Register to comment.