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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
Hi PeterNL,
As a last resort I'd do...
http://uk.php.net/manual/en/function.number-format.php
But 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)
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.
Thanks for your time you both, i now use the TextField and jQuery to count values.
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.
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?