PHP 8.6.0 Alpha 2 available for testing

Voting

: four plus two?
(Example: nine)

The Note You're Voting On

Jeroen de Bruijn [NL]
20 years ago
If you want to display a number ending with ,- (like 200,-) when there are no decimal characters and display the decimals when there are decimal characters i use:
function DisplayDouble($value)
 {
 list($whole, $decimals) = split ('[.,]', $value, 2);
 if (intval($decimals) > 0)
 return number_format($value,2,".",",");
 else
 return number_format($value,0,".",",") .",-";
 }

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /