Skip to main content
Question

How to obtain Fixed decimal values ?


magi
Forum|alt.badge.img

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

magi
Forum|alt.badge.img
  • Author
  • June 21, 2022

Highly obliged with your response or input or help :)

 


dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • June 21, 2022

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


magi
Forum|alt.badge.img
  • Author
  • June 21, 2022

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

 

image


tomfriedl
Contributor
Forum|alt.badge.img+13
  • Contributor
  • June 22, 2022

Use StringFormatter is IMHO simple.


magi
Forum|alt.badge.img
  • Author
  • June 22, 2022

thank you @tomfriedl


magi
Forum|alt.badge.img
  • Author
  • June 22, 2022
tomfriedl wrote:

Use StringFormatter is IMHO simple.

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

 

image


tomfriedl
Contributor
Forum|alt.badge.img+13
  • Contributor
  • June 22, 2022

Format String: .3f

You do not need AttributeRounder and StringFormatter.


magi
Forum|alt.badge.img
  • Author
  • June 22, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings