Question

How to obtain Fixed decimal values ?


Badge

Hi

 

i have values as example as below and would like to round upto 3 decimal evenly.

1968.741344

5977.675803

1968.93

5983.1

 

attribute rounder 1 

Am using above transformer to round up but it returns

1968.741

5977.676

1968.93

5983.1

 

AND i want

 

1968.741344 >>>>>>>> 1968.741

 

5977.675803 >>>>>5977.676

 

1968.93 >>>>>>> 1968.930

 

5983.1 >>>>>>. 5983.100


8 replies

Badge

Highly obliged with your response or input or help :)

 

Userlevel 3
Badge +26

One possible solution:

 

If you place an AttributeManager after your AttributeRounder, you could use these conditional parameters with regex on each of the attributes. This will add the appropriate zeros based on what the value ends with.imageBefore:imageAfter:image

Badge

Thank you so much, making my life easy @dustin​ 

 

image

Userlevel 2
Badge +12

Use StringFormatter is IMHO simple.

Badge

thank you @tomfriedl

Badge

Use StringFormatter is IMHO simple.

@tomfriedl​ please what would be the string that i should write ? Please excuse i am new user

 

image

Userlevel 2
Badge +12

Format String: .3f

You do not need AttributeRounder and StringFormatter.

Badge

Hi tom that do go very well its return me value @tomfriedl​ image

Reply