andrewagain/calculator

Not showing percentage result

farhansaifi48 opened this issue · 1 comments

Paste below code into calculate.js file
`
if(buttonName === '%') {
if (obj.next && obj.operation) {
return {
total: operate(obj.total, obj.next, '%'),
next: null,
operation: null,
};
} else {
// '=' with no operation, nothing to do
return {};
}
}

`

Issue will be solved and show percentage result
Thanks

Thanks for reporting the issue! My original implementation had % sign doing the modulus operation but you're right - it should divide by 100 to match the Mac calculator.

Fixed with bc78cfe