You need to sign in to do that
Don't have an account?
Abhay Mohan
Calculate SI And CI
Hi All,
I m new in lightning and try some basic .... can anyone help me out... Output is not showing properly
Component Program
=================
<aura:component >
<aura:attribute name = "Amt" type = "decimal"/>
<aura:attribute name = "ROI" type = "decimal"/>
<aura:attribute name = "Tm" type = "decimal"/>
<aura:attribute name = "Intr" type = "decimal"/>
<aura:attribute name = "Toamt" type = "decimal"/>
<lightning:card title = "Simple and Compound Interest" iconName= "standard:apps">
<aura:set attribute = "actions">
<lightning:buttonGroup>
<lightning:button label = "Simple Interest" onclick = "{!c.simpme}" variant = "success"/>
<lightning:button label = "Compound Interest" onclick = "{!c.compme}" variant = "brand"/>
</lightning:buttonGroup>
</aura:set>
<lightning:input label="Amount" value="{!v.Amt}"/>
<lightning:input label="Rate of Interest" value="{!v.ROI}"/>
<lightning:input label="Term" value="{!v.Tm}"/>
<lightning:input label="Interest Accumulated at the End of Term" value="{!v.Intr}"/>
<lightning:input label="Total Maturity Amount" value="{!v.Toamt}"/>
</lightning:card>
</aura:component>
Controller Program
===============
({
simpme : function(component, event, helper)
{
var P = component.get("v.amt");
var T = component.get("v.ROI");
var R = component.get("v.Tm");
var res = (P*T*R)/100;
component.set("v.intr", res);
var tamt = parseInt(P)+parseInt(res);
component.set("v.Toamt", tamt);
},
compme : function(component, event, helper)
{
var P = component.get("v.amt");
var T = component.get("v.ROI");
var R = component.get("v.Tm");
var res = P*(1+R/100)^T;
component.set("v.intr", res);
var tamt = parseInt(P)+parseInt(res);
component.set("v.Toamt", tamt);
}
})
I m new in lightning and try some basic .... can anyone help me out... Output is not showing properly
Component Program
=================
<aura:component >
<aura:attribute name = "Amt" type = "decimal"/>
<aura:attribute name = "ROI" type = "decimal"/>
<aura:attribute name = "Tm" type = "decimal"/>
<aura:attribute name = "Intr" type = "decimal"/>
<aura:attribute name = "Toamt" type = "decimal"/>
<lightning:card title = "Simple and Compound Interest" iconName= "standard:apps">
<aura:set attribute = "actions">
<lightning:buttonGroup>
<lightning:button label = "Simple Interest" onclick = "{!c.simpme}" variant = "success"/>
<lightning:button label = "Compound Interest" onclick = "{!c.compme}" variant = "brand"/>
</lightning:buttonGroup>
</aura:set>
<lightning:input label="Amount" value="{!v.Amt}"/>
<lightning:input label="Rate of Interest" value="{!v.ROI}"/>
<lightning:input label="Term" value="{!v.Tm}"/>
<lightning:input label="Interest Accumulated at the End of Term" value="{!v.Intr}"/>
<lightning:input label="Total Maturity Amount" value="{!v.Toamt}"/>
</lightning:card>
</aura:component>
Controller Program
===============
({
simpme : function(component, event, helper)
{
var P = component.get("v.amt");
var T = component.get("v.ROI");
var R = component.get("v.Tm");
var res = (P*T*R)/100;
component.set("v.intr", res);
var tamt = parseInt(P)+parseInt(res);
component.set("v.Toamt", tamt);
},
compme : function(component, event, helper)
{
var P = component.get("v.amt");
var T = component.get("v.ROI");
var R = component.get("v.Tm");
var res = P*(1+R/100)^T;
component.set("v.intr", res);
var tamt = parseInt(P)+parseInt(res);
component.set("v.Toamt", tamt);
}
})
Please take reference from the below code:-
In case you find any other issue please mention.
If you find your Solution then mark this as the best answer.
All Answers
Please take reference from the below code:-
In case you find any other issue please mention.
If you find your Solution then mark this as the best answer.