21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2674 Views |
-
Currency format 10,000.00 to 10.000,00

17 December 2010 at 10:28pm
Hello all,
I have a problem with the currency, in the netherlands we use 10.000,00 how can i make it that way?
I hope someone could help me, i searched the hole forum.
Thank you
-
Re: Currency format 10,000.00 to 10.000,00

18 December 2010 at 2:14am
Hi PeterNL,
As a last resort I'd do...
http://uk.php.net/manual/en/function.number-format.phpBut to be able to help more it would be nice to know more informabout how you are storing the data... e.g.
If you are using MoneyField it has setLocale... would this help? (it my also depend on internal php settings)
-
Re: Currency format 10,000.00 to 10.000,00

18 December 2010 at 3:04am
Hi
If you're writing your own code, extending the Currency class could also be an option, or you could add a function (custom getter) to your class-that-uses-the-Currency to return the correct format. If it's about some existing module however...
Like Swaiba said, it depends upon what you're trying to do.
-
Re: Currency format 10,000.00 to 10.000,00

20 December 2010 at 2:17am
Thanks for your time you both, i now use the TextField and jQuery to count values.
-
Re: Currency format 10,000.00 to 10.000,00

20 December 2010 at 3:36am
how are you using jQuery to count values?
are you using this in ModelAdmin, Forms, etc?
I define my money/currency/prices in the DB like this...
'Price' => 'Decimal(6,2)',
And currently I don't have a need for this to work outside the UK, but it is coming to Spain and us soon so I will be looking to use translatable dataobject extension and might end up with a CurrencyField or MoneyField.
If you were to create an NLDecimal, by extending Decimal you could override the function 'Nice' to specify the decimal and thousand separator.
-
Re: Currency format 10,000.00 to 10.000,00

20 December 2010 at 5:23am
Till now I've always gone for extending the Currency class. It wouldn't be too hard to create something that generates output based on the current locale, would it?
Maybe something that uses localeconv() - unless specified otherwise?
| 2674 Views | ||
|
Page:
1
|
Go to Top |


