How to set SKILL floating point precision to XX.XX

P

Peter Holm

Guest
Hi,

I am writing a SKILL function which modifies transistor elements in a
schematic. Some calculations result in width properties with values
like 2.32222222. Is there a way to round this to 2.32 in the database?
Thanks.
 
Depends on if you really want to do a mathematical rounding
round( 2.32222222 * 100.0 ) / 100.0
or if you just want the value to be displayed that way
printf( "%.2f\n" 2.32222222 )
Then have also a look at the function 'aelPushSignifDigits'.

Bernd

Peter Holm wrote:
Hi,

I am writing a SKILL function which modifies transistor elements in a
schematic. Some calculations result in width properties with values
like 2.32222222. Is there a way to round this to 2.32 in the database?
Thanks.
 
Bernd Fischer wrote:
Depends on if you really want to do a mathematical rounding
round( 2.32222222 * 100.0 ) / 100.0
or if you just want the value to be displayed that way
printf( "%.2f\n" 2.32222222 )
Then have also a look at the function 'aelPushSignifDigits'.

Bernd

Peter Holm wrote:
Hi,

I am writing a SKILL function which modifies transistor elements in a
schematic. Some calculations result in width properties with values
like 2.32222222. Is there a way to round this to 2.32 in the database?
Thanks.

May be if you want round off to a grid value than try this
in this every calculation will be a multiple of .005


w_mj_true=w_mj
w_mj=round(w_mj/.005)*.005

Bye
Manish jain
 

Welcome to EDABoard.com

Sponsor

Back
Top