CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > Tecplot

Macro that rounds a value

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2014, 06:02
Default Macro that rounds a value
  #1
New Member
 
chris
Join Date: Feb 2014
Posts: 3
Rep Power: 12
sees is on a distinguished road
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?
Thanks
sees is offline   Reply With Quote

Old   February 7, 2014, 08:05
Default
  #2
New Member
 
chris
Join Date: Feb 2014
Posts: 3
Rep Power: 12
sees is on a distinguished road
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.

bye
sees is offline   Reply With Quote

Reply

Tags
macro, round


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
StarCCM+ Command line options and Macro execution isidp STAR-CCM+ 8 January 29, 2013 05:00
Macro Trouble -Winows Explorer Crashes with Macro Martin Castillo FLUENT 1 July 25, 2007 04:18
Macro problem cfddummy Siemens 1 April 9, 2007 12:37
macro not function! guang ai Siemens 0 July 25, 2004 18:53
Call a macro from a macro Flav Siemens 2 July 1, 2004 05:42


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