Topic: math

Hi all,
How can I calculate and find the result of 25*8% in script?

Re: math

a=25
b=8
c=x

c = a*(b/100)

Re: math

Yeap....
And another question how to keep the two first digits after the comma from a number. Lets say we have the nr 3.56520 it should give the result 3.57

4 (edited by iwkom 2022-06-11 10:03:52)

Re: math

If c is strng
c := FormatFloat('0.##', StrToFloat(c));

if c is real
c := FormatFloat('0.##', c);

Re: math

Thank you