Rounding to 2dp

How do you round or trunckate floating point values to 2 decimal places?

Comments

  • : How do you round or trunckate floating point values to 2 decimal places?
    :
    Result := Trunc(Value * 100) / 100;

    But it's better to just modify the outputting. Format('%.2f', Value)


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion