CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Tecplot

Macro that rounds a value

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 7, 2014, 07:02
Default Macro that rounds a value
  #1
New Member
 
chris
Join Date: Feb 2014
Posts: 3
Rep Power: 3
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, 09:05
Default
  #2
New Member
 
chris
Join Date: Feb 2014
Posts: 3
Rep Power: 3
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

Thread Tools
Display Modes

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 On
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 06:00
Macro Trouble -Winows Explorer Crashes with Macro Martin Castillo FLUENT 1 July 25, 2007 04:18
Macro problem cfddummy CD-adapco 1 April 9, 2007 12:37
macro not function! guang ai CD-adapco 0 July 25, 2004 18:53
Call a macro from a macro Flav CD-adapco 2 July 1, 2004 05:42


All times are GMT -4. The time now is 07:22.