1234567891011121314151617181920212223242526272829 |
- var totalprices = function (count, price) {
- var count=count;
- var price=price;
- return (count * price).toFixed(2)
- }
- var sum = function (allPrice, discounts) {
- var allPrice=allPrice;
- var discounts=discounts;
- return (allPrice - discounts).toFixed(2)
- }
- var add = function(price = 0 ,prices = 0){
- return (price+prices).toFixed(2);
- }
- var tofd = function(num,t_num = 2){
- return num.toFixed(t_num)
- }
- var math = function(val){
- return Math.abs(val)
- }
- module.exports = {
- totalprices: totalprices,
- sum:sum,
- add:add,
- tofd:tofd,
- math:math
- }
|