0

I have this Lightning input :

<lightning:input type="number" aura:id="testPercent" label="Percentage" name="testPercent" formatter="percent-fixed" step="0.01" value="{!v.newExpense.percentage}" />

The problem is that when i set the value to '7.4', it displayes it '7' automatically. But i don't have the same issue when i set the value to '7.3' for example.

Can you help me please ? Is it a Lightning bug ?

  • 1
    Whats the datatype for attribute percent? and are you on Summer 18 or Spring 18? – Pranay Jaiswal Jun 7 '18 at 9:36
0

Yes this is a bug.

https://success.salesforce.com/issues_view?id=a1p3A000000mCf0QAE

See this and cick in "this affect me"

| improve this answer | |
0

Use attribute type Double when you are using Percent formatter in Lightning:input.

<aura:attribute name="percentage" type="Double" default="7.2" /> <lightning:input type="number" aura:id="testPercent" label="Percentage" name="testPercent" formatter="percent-fixed" step="0.01" value =" {!v.percentage}" />

It's working fine for me. If you want to bind input value to the Record value, use Percentage field.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.