How to ignore characters after decimal/period

How do i ignore digits after the decimal. for example, 5678.79, i want to save the integer as 5678.

If i wanted to round the number up before saving it, how would i do this? for example, 5678.79 becomes 5679?

if the number is 5678.39, will this round to 5679 or round to 5678?

Thanks

1 Like

for this to be very simple
we can use use this expression
str_output = Split(str_input,".")(0).tostring
where str_input = “5678.79”

and for this

yah it would obviously round up from 5678.79 to 5679 because its .79 (which is more than 5)
and to round up we can use this expression
Math.Round(5678.79)
which will give us the roundup value

and finally for this

it will round upt to 5679

Cheers @happygal321

Thanks!

If i have the integer -5678, how do i split it to - and 5678?

like this
Split("-5678","-")(1).ToString

Cheers @happygal321

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.