How do you calculate formatted values | Community
Skip to main content
ReluctantProgrammer
Level 4
August 11, 2021
Solved

How do you calculate formatted values

  • August 11, 2021
  • 1 reply
  • 1287 views

I'm trying to calculate the total of 2 fields which have been formatted using math.floor; I want to calculate the formatted amount of these 2 fields, NOT the rawValue.  How can I do this?

 

example: 

Field 1 rawValue = 700.44                                    Field 1 formatted value = 700.4

Field 2 rawValue = .42                                          Field 2 formatted value = .4

Total rawValue  =  700.86 (rounded 700.9)          Total formatted value = 700.8 ;  this is what I need to do

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Asutosh_Jena_

Hi @reluctantprogrammer 

 

Try this:

(Math.round(700.44*10)/10)+(Math.round(0.42*10)/10);

Thanks!  

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
August 12, 2021

Hi @reluctantprogrammer 

 

Try this:

(Math.round(700.44*10)/10)+(Math.round(0.42*10)/10);

Thanks!  

ReluctantProgrammer
Level 4
August 12, 2021

Awesome!  I was soooo close.  Thanks so much!!