mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-08 18:48:22 +01:00
Clean code
This commit is contained in:
@@ -5274,8 +5274,9 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
* Put 2 if you know that number is a user input (so we know we don't have to fix decimal separator).
|
||||
* @return string Amount with universal numeric format (Example: '99.99999').
|
||||
* If conversion fails to return a numeric, it returns:
|
||||
* text unchanged or partial if ($rounding = ''): price2num('W9ç', '', 0) => '9ç', price2num('W9ç', '', 1) => 'W9ç', price2num('W9ç', '', 2) => '9ç'
|
||||
* '0' if ($rounding is defined): price2num('W9ç', 'MT', 0) => '9', price2num('W9ç', 'MT', 1) => '0', price2num('W9ç', 'MT', 2) => '9'
|
||||
* - text unchanged or partial if ($rounding = ''): price2num('W9ç', '', 0) => '9ç', price2num('W9ç', '', 1) => 'W9ç', price2num('W9ç', '', 2) => '9ç'
|
||||
* - '0' if ($rounding is defined): price2num('W9ç', 'MT', 0) => '9', price2num('W9ç', 'MT', 1) => '0', price2num('W9ç', 'MT', 2) => '9'
|
||||
* Note: The best way to guarantee a numeric value is to add a cast (float) before the price2num().
|
||||
* If amount is null or '', it returns '' if $rounding = '' or '0' if $rounding is defined.
|
||||
*
|
||||
* @see price() Opposite function of price2num
|
||||
|
||||
Reference in New Issue
Block a user