多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
623 B

  1. // 分别截取 价格小数点前后的数字
  2. export const PriceFilter = {
  3. // 小数点前
  4. radixPointBefore: price => {
  5. if (price == undefined) {
  6. return
  7. }
  8. price = price.toString()
  9. if (price && price.indexOf(".") != -1) {
  10. return price.substring(0, price.indexOf("."))
  11. } else {
  12. return price;
  13. }
  14. },
  15. // 小数点后
  16. radixPointAfter: price => {
  17. if (price == undefined) {
  18. return
  19. }
  20. price = price.toString()
  21. if (price && price.indexOf(".") != -1) {
  22. return price.substring(price.indexOf("."), price.length)
  23. } else {
  24. return ".00";
  25. }
  26. }
  27. }