js/calc-model.js
/* User call this function to give input values. */
User call this function to give input values.
User call this function to give input values .
function input(ch) {
    if (!current()) data.operands.push(['0']);
    if (ch === '.') {
        if (!hasDot(current())) { 
            current().push(ch);
        }
    } else {
        if (onlyLeadingZero(current())) current().splice(0, 1);
        current().push(ch);
    }
    data.show = current();
}
function input ( ch ) { if ( ! current ( ) ) data . operands . push ( [ '0' ] ) ; if ( ch === '.' ) { if ( ! hasDot ( current ( ) ) ) { current ( ) . push ( ch ) ; } } else { if ( onlyLeadingZero ( current ( ) ) ) current ( ) . splice ( 0 , 1 ) ; current ( ) . push ( ch ) ; } data . show = current ( ) ; }
User call this function to give input values.
User call this function to give input values .
// Each operand can have only one dot.