抖音b端
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.

22 regels
606 B

  1. //货币单位转换
  2. export function changeNumber(num) {
  3. var changeNum = 0;
  4. if (num < 1000000) {
  5. return num / 100;
  6. } else if (num >= 1000000 && num < 10000000000) {
  7. return (num / 1000000).toFixed(2) + '万'
  8. } else if (num > 10000000000) {
  9. return (num / 10000000000).toFixed(2) + '亿'
  10. }
  11. }
  12. //人数单位转换
  13. export function changePeoNumber(num) {
  14. var changeNum = 0;
  15. if (num < 10000) {
  16. return num;
  17. } else if (num >= 10000 && num < 100000000) {
  18. return (num / 10000).toFixed(2) + '万'
  19. } else if (num > 100000000) {
  20. return (num / 100000000).toFixed(2) + '亿'
  21. }
  22. }