+ Start a Discussion
Maria Alexandra Andrica 6Maria Alexandra Andrica 6 



I'm trying to insert a negative number but it does not allow me to enter a minus. 

<lightning:input min="-10.0" type="number" formatter="decimal" step = ".01" value="{!v.price}" onchange="{!c.calc}"/>
Best Answer chosen by Maria Alexandra Andrica 6
Hi Maria,

I have gone through your problem.

Go through the below code


<aura:component >
    <aura:attribute name="price" type="string" />
    <lightning:input type="number" name="input1" label="Enter a date" value="{!v.price}" onchange="{!c.calc}" min="-10.0"/>


    calc : function(c, e, h) {
        var recordName = e.getSource().get('v.value');

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora