Come posso far mostrare sempre il segno di un numero?
Come posso far mostrare sempre il segno di un numero?
GdR Online - http://lenar.it/
Yesterday is history. Tomorrow is mystery.
Today is a gift. That's why it's called the present
se faccio una operazione..ad esempio: 5*2= 10 e se faccio 5*(-2)=-10 io vorrei che anche quando il numero viene positivo ci sia davanti il + visibile e non sia sottointeso.
GdR Online - http://lenar.it/
Yesterday is history. Tomorrow is mystery.
Today is a gift. That's why it's called the present
function numToSign($num){return ($num>0?'+'.$num: (string)$num);}
ovviamente se è 0 c'è poco da mettere il segno![]()