cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Got a minute? We appreciate your feedback:

Graphisoft Learn survey
Archicad C++ API
About Archicad add-on development using the C++ API.

Is there a way to limit decimal or round off values coming from API?

cad developer
Contributor

Hi,

 

As the subject suggests there is a need to limit the decimal of the property values that is coming from an API. 

The decimal limited value should be rounded off to the specified decimal. 

 

For example the property 'volume' of 'API_RailingBalusterQuantity' is giving a value of 7.1108929735418900e-05 or 0.0000711089297354189, but we would like that value to be rounded off to 4 decimal places. 

 

The value should be '0.0001'. 

 

Please help me on this. 

 

Thanks & Regards

1 ACCEPTED SOLUTION
1 REPLY 1

Solution
Miha Nahtigal
Advocate

I dont exactly understand the question.

 

The result of API_RailingBalusterQuantity() gets stored to local variable. After that you can round it as you desire using c/c++ functions/routines like round().

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!