Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Calculate the % of Change

$
0
0

I need to calculate the % change from A to B.  I've used the Simplified field notation and came up with the correct value:

 

(A-B)/B

 

However, I need this value to be formatted as a percentage and "A" and "B" are formatted as currency.  I formatted the field and I get the error "The Value Entered does not match the format of the field [field name]"

 

When I change the format to "none" and change the formula to ((A-B)/B)*100 I get the correct value with no errors however I don't get the % sign and I have no control over decimal places.

 

Common issues I've seen in researching this is field names and all mine are alpha characters.

 

Is it possible to use the SFN with multiple field formats? If not, how do I write this in JavaScript?


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>