no decimal places without round

kanikakanika Member Posts: 247
Hi experts!!

I have 562.321,55

but I need 562.321 (without round)

and I don't get it.

please help me.

Answers

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    Try
    Str:=FORMAT(562.321,55);
    Res:= COPYSTR(Str, 1, SUBSTR(Str,','));

    I hope this helps.
    Thanks.
  • vaprogvaprog Member Posts: 1,140
    Hi

    If you need the result as decimal or integer use
    ROUND(562321.55,1,'<')
    
    If you need the result as string use
    FORMAT(562321.55,0,'<Sign><Integer Thousand>')
    
    Both functions in effect just chop off the decimals, or expressed differently: they round towards 0, negative values get greater, positive smaller.

    Above code, contrary to vremeni4's, is locale agnostic.
  • kanikakanika Member Posts: 247
    ok! Thank you, both answers help me
Sign In or Register to comment.