• Abhay Mohan
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
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);
    }
})
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);
    }
})