[TYPO3-core] RFC #13815: Feature: Add .numberFormat function to stdWrap

Sebastian Gebhard sebastiangebhard at hoch2.de
Tue Apr 13 09:06:26 CEST 2010


This is an SVN patch request.

Type: New feature

Bugtracker references: http://bugs.typo3.org/view.php?id=13815

Branches: trunk

Problem:
When handling prices or other special formated Numbers in TypoScript 
there's no reasonable way to format it properly. When there's a price 
like 0.8 in your Database you can't transform it to 0,80 easily.

Solution:
Implement .numberFormat as stdWrap property

Notes:
.numberFormat has following properties:
decimals, dec_point, thousands_sep
They correspond to the parameters of php's number_format() function.
http://de.php.net/manual/en/function.number-format.php

How to test:
tmp.myNumber = TEXT
tmp.myNumber{
   value = 0.8
   numberFormat{
     decimals = 2
     dec_point = ,
     thousands_sep = .
   }
}

Will output "0,80"


Kind regards,
Sebastian Gebhard
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 13815_v1.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100413/ade26324/attachment.txt>


More information about the TYPO3-team-core mailing list