Select only two decimal places not round

Hi,

Can you help me please how to select only two decimal places and not round the result for example:

$example = 4.57969 

$result = 4.57 not 4.58

Thanks in advance!

Parents
No Data
Reply
  • Another way to do that is to multiply the number, truncate it and then divide it again. But you have to look out for integer boundaries. Works great for small enough numbers and precisions.

    [Math]::Truncate($example*100)/100

Children
No Data