Revision #7 has been created by c@cba on Aug 1, 2012, 5:05:55 PM with the memo:
added related links. edited first paragraph (visible as summary in wiki-list) is clearer.
« previous (#6) next (#8) »
Custom Number Formatting or Decimal Separators and i18n
decimal separator, number format, i18n, customize, floating point numbers, localization
By default, the decimal separator in php (also in mysql) is a dot (.).
So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot.
If we want to use for example a comma (,) as the decimal separator
in our application
, we have to
1. format the float value before printing/echoing : handle the output : 4.45 => "4,45"
If something is unclear, wrong or incomplete, please let me know. Any suggestions for improvements will be appreciated!