Base solution for your next web application
Open Closed

Decimal separator #6197


User avatar
0
mirzanas created

Hello, any recommendation on how to use ',' as decimal separator. Currently BE automatically converts 99,99 to 9999.00


5 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi @mirzanas, are you using Anuglar or jQuery version of ANZ?

    You should format the number at client side (javascript) when displaying the value

  • User Avatar
    0
    mirzanas created

    Hey, i am using angular.

    I am formatting number at client side as well i can see in browser network tab what a request contains correct value e.g. price: "99,99", but when BE receives it the value is 9999.00.

    As I understood a default model binder do this trick. Do you have any recommendation on how to overcome this issue?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mirzanas

    Have you figured out a solution ?

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, @mirzanas, if your network request is sending "99,999" and your BE received 99999.00, this means that you are sending string in your network request where your BE is expecting it to be decimal. Asp.Net model binding will covert the string into decimal (because your BE model is expecting it as decimal) if the string is a number

  • User Avatar
    0
    mirzanas created

    Ok, thanks.