Hello,
Id iike to show my numbers like they are shown in the backend using NumericField. Is there a way to get that without string-manipulation?
Thanks in advance and best wishes
Fabian
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,
Id iike to show my numbers like they are shown in the backend using NumericField. Is there a way to get that without string-manipulation?
Thanks in advance and best wishes
Fabian
Hi,
When outputting a decimal number in a template you can use the .Nice function to format the number.
For example: $MyDecimalNumber.Nice
Int numbers have a .Formatted function which does a similar thing, example: $MyIntNumber.Formatted
Both of these will add the thousands separator and for decimals the decimal point will be included too.
Regards,
DouG.
Hej DouG,
thanks a lot ;)
Regards,
Fabian