This is a migrated thread and some comments may be shown as answers.
Formatting currency with big amounts from variable not working.
1 Answer 13 Views
This is a migrated thread and some comments may be shown as answers.
Harry
Top achievements
Rank 1
Harry asked on 07 Jan 2014, 01:17 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Harry
Top achievements
Rank 1
answered on 07 Jan 2014, 01:49 PM
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! :-)
Asked by
Harry
Top achievements
Rank 1
Answers by
Harry
Top achievements
Rank 1
Share this question
or