Rounding to 2dp - Programmers Heaven

Howdy, Stranger!

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

Categories

Rounding to 2dp

zicheziche Posts: 47Member
How do you round or trunckate floating point values to 2 decimal places?

Comments

  • MasterijnMasterijn Posts: 188Member
    : 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.