2
0
forked from Wavyzz/dolibarr

Clean code by adding cast int.

This commit is contained in:
Laurent Destailleur
2021-08-27 18:18:50 +02:00
parent 2f225ee7e5
commit 3b6559b1a6
55 changed files with 215 additions and 213 deletions

View File

@@ -5273,8 +5273,10 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
* @param int $option Put 1 if you know that content is already universal format number (so no correction on decimal will be done)
* 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, it return text unchanged if ($rounding = '' and $option = 1) or '0' if ($rounding is defined and $option = 1).
* If amount is null or '', it returns '' if $rounding = '' or '0' if $rounding is defined..
* 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'
* If amount is null or '', it returns '' if $rounding = '' or '0' if $rounding is defined.
*
* @see price() Opposite function of price2num
*/