function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC AlexSFDC Alex 

Difference between "percent" and "percent-fixed"

Hi All,

Can someone please explain the difference between "percent" and "percent-fixed"? Also when to use which amon these two.
I am confused over here.

Thanks in Advance,
SFDC Alex
Best Answer chosen by SFDC Alex
nehakumarinehakumari
Hi Alex,
If you use "percent" and provide your input as 1, it is displayed as "100%" (Multiplied by 100).
If you use "percent-fixed" and provide the input as 1, it is displayed as "1%" (Displays your input value as is)

All Answers

nehakumarinehakumari
Hi Alex,
If you use "percent" and provide your input as 1, it is displayed as "100%" (Multiplied by 100).
If you use "percent-fixed" and provide the input as 1, it is displayed as "1%" (Displays your input value as is)
This was selected as the best answer
SFDC AlexSFDC Alex
Hi Neha,

Thanks for the answer!!!

Just out of curiosity, can the input be given as decimal number such as 0.01 in case of "percent" if someone tries to match its functionality with "percent-fixed"?

Thanks in Advance,
SFDC Alex
nehakumarinehakumari

I don't think so. You can use lightning:fomattedNumber with style "percent" for that. 
<lightning:formattedNumber value="0.01" style="percent" />  ==>  1%
Note that, you can't use "percent-fixed" in this case as the result will be as below: 
<lightning:formattedNumber value="0.01" style="percent-fixed" />   ==>  0%

SFDC AlexSFDC Alex
Thanks for the answer Neha! Helped me a lot!!!