Q:

Convert string to number in component

When I get the value from model I am getting like "HKD 112" - But I require to set back like 112 how to convert to Number in model?
here is my try:
import Ember from 'ember';

export default Ember.Component.extend({
    defaultBalanceType:"Please Select a Balance",
    defaultInstalment:"Please Select",
    payToAmount:null,
    monthlyInstalment(){
        this.get('selectedCreditCard.model').set("monthlyInstalment", parseInt(this.get('payToAmount')) );//not working gives `NaN`
    },
    actions:{
        selectedBalaceType:function( balance ){
            this.set("selectedBalance", balance );
            this.set("payToAmount", balance.get("amount"));
        },

        selectATunure : function( tunure ){
            this.set("selectedTunure", tunure);
            this.monthlyInstalment();
        }
    }
});

A:

The problem is that parseInt tries to convert from the first character therefore you are getting NaN.
If you always have a space between your letters and numbers you could do something like this...
var splittedDayToAmount = this.get('payToAmount').split(" ");
this.get('selectedCreditCard.model').set("monthlyInstalment", parseInt(splittedDayToAmount[1]) );

