Formatting currency with big amounts from variable not working.

2 posts, 1 answers
  1. Harry
    Harry avatar
    2 posts
    Member since:
    Dec 2013

    Posted 07 Jan 2014 Link to this post

    Hi,

    I've created a template that displays a big amount of money (> 1.000.000.000). Unfortunately the formatter doesn't seem to handle big numbers from an input variable.
    // transactionAmount = 1000000000 and is stored in the field of a model
     
    // In the template definition I see this unexpected result:
    #: kendo.toString(get("transactionAmount"), "c") # // result: 1000000000
     
    // Smaller or hard-coded amounts work fine:
    #: kendo.toString(get("transactionAmount")/1000, "c") # // result: € 1.000.000,00
    #: kendo.toString(1000000000, "c") # // result: € 1.000.000.000,00
    Am I doing something wrong, or is this a bug? Thanks for your help!

    Best regards,

    Harry van Mierloo
  2. Answer
    Harry
    Harry avatar
    2 posts
    Member since:
    Dec 2013

    Posted 07 Jan 2014 Link to this post

    I've found the cause of the problem: Although I've defined the used field type of the model to be "number", I had accidentally instantiated it by passing the amount as a string instead of a number. This did not raise an error, so I was unaware of it.

    Never mind, but thanks anyway! :-)
  3. Kendo UI is VS 2017 Ready
Back to Top