CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Tecplot (
-   -   Macro that rounds a value (

sees February 7, 2014 07:02

Macro that rounds a value
I tried writing a macro that at some point needs to round a value. This is causing me an error, so maybe someone already knows how to round within a macro which seems to be a problem for me.

My current code looks like this (simplified)
$!VarSet |A| = 5
$!VarSet |B| = 9

$!VarSet |C| = (|A|/|B|)

$!VarSet |Crounded| = ROUND( |C| )
and the error message says that in $!VarSet |Crounded| = ROUND( |C| ) an error occured.

Do I have to use a different way to get a rounded value in a macro? :confused:

sees February 7, 2014 09:05

Ok I found my solution.
Since round is not known as a function but ceil and floor are, I just add 0.5 and then use the ceil function.


All times are GMT -4. The time now is 00:03.