MarginLon MarginLon
首页
  • Web

    • Web基础
    • Web布局
    • CodeSnippet
  • Vue

    • Vue
  • React

    • React
  • Node.js

    • Node.js
  • 技术文档
  • UI组件库
  • 动画库
  • 图形库
  • 桌面端
  • 学习笔记
  • 生活笔记
关于
收藏
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

MarginLon

http://info.cern.ch
首页
  • Web

    • Web基础
    • Web布局
    • CodeSnippet
  • Vue

    • Vue
  • React

    • React
  • Node.js

    • Node.js
  • 技术文档
  • UI组件库
  • 动画库
  • 图形库
  • 桌面端
  • 学习笔记
  • 生活笔记
关于
收藏
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • Web基础

  • Web布局

  • CodeSnippet

    • 解构赋值
    • 数字转中文
  • Vue

  • React

  • 前端
  • CodeSnippet
MarginLon
2022-10-17

数字转中文

export function transformNumber(number) {
  const INDEX_MAP = ['零', '一'......]
  if(!number) return
  if(number === 10) return INDEX_MAP[number]
  return [...number.toString()].reduce((pre, cur) => pre + INDEX_MAP[cur], '')
}
1
2
3
4
5
6
编辑 (opens new window)
上次更新: 2023/09/17, 23:41:49
解构赋值
Vue在css中使用js的变量

← 解构赋值 Vue在css中使用js的变量→

最近更新
01
KnockoutJS
11-12
02
综述
10-17
03
前言
10-12
更多文章>
Theme by Vdoing | Copyright © 2019-2024 MarginLon | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式