Probably a stupid question but i have some troubles with rounding up numbers. So just like 3/2 = 2
It Always has to be rounded to the biggest number.
Any suggestions here? (i don't use the oscat library)
Many thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I needed that conversation for getting the correct number of column and row, out of the (overall) count of an array (to correct the code of OSCAT's "CSV_PARSER_FILE_DEMO"). It works with the integrated truncation feature while calculating with integer values. Or you look after "ROUND" functions in OSCAT's library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Probably a stupid question but i have some troubles with rounding up numbers. So just like 3/2 = 2
It Always has to be rounded to the biggest number.
Any suggestions here? (i don't use the oscat library)
Many thanks.
So what do you want ?
If you want to be see 3/2 = 1.5
you have to define LREAL variable.
For example,
variable1 : LREAL;
variable1 := 3/2;
so, you can see variable1 = 1.5
Originally created by: scott_cunningham
There are many ways to always round up, but here is one:
Thank you. I tried it and it worked
a/b+((a div b)+(b-1))/b
My proposal for integer values:
I needed that conversation for getting the correct number of column and row, out of the (overall) count of an array (to correct the code of OSCAT's "CSV_PARSER_FILE_DEMO"). It works with the integrated truncation feature while calculating with integer values. Or you look after "ROUND" functions in OSCAT's library.