totalprices.wxs 584 B

1234567891011121314151617181920212223242526272829
  1. var totalprices = function (count, price) {
  2. var count=count;
  3. var price=price;
  4. return (count * price).toFixed(2)
  5. }
  6. var sum = function (allPrice, discounts) {
  7. var allPrice=allPrice;
  8. var discounts=discounts;
  9. return (allPrice - discounts).toFixed(2)
  10. }
  11. var add = function(price = 0 ,prices = 0){
  12. return (price+prices).toFixed(2);
  13. }
  14. var tofd = function(num,t_num = 2){
  15. return num.toFixed(t_num)
  16. }
  17. var math = function(val){
  18. return Math.abs(val)
  19. }
  20. module.exports = {
  21. totalprices: totalprices,
  22. sum:sum,
  23. add:add,
  24. tofd:tofd,
  25. math:math
  26. }