How to use nzh - 10 common examples

To help you get started, we’ve selected a few nzh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Ice-Hazymoon / MikuTools / pages / number_to_zh.vue View on Github external
isZhNum() {
            if (!this.hanzi.length) {
                this.$swal({
                    type: 'error',
                    title: '转换失败',
                    text: `ERROR: 你还没有输入`
                });
                return;
            }
            const regexlower = /^负?[零一二三四五六七八九十百千万亿]*点?[零一二三四五六七八九]*$/g;
            const regexupper = /^负?[零壹贰叁肆伍陆柒捌玖拾佰仟万亿]*点?[零壹贰叁肆伍陆柒捌玖]*$/g;
            if (regexlower.test(this.hanzi)) {
                this.numResult = Nzh.cn.decodeS(this.hanzi);
            } else if (regexupper.test(this.hanzi)) {
                this.numResult = Nzh.cn.decodeB(this.hanzi);
            } else {
                this.$swal({
                    type: 'error',
                    title: '转换失败',
                    text: `ERROR: 请输入正确的大小写中文数字`
                });
                return;
            }
        }
    }
github umijs / umi-blocks / ant-design-pro / StepForm / src / utils / utils.js View on Github external
export function digitUppercase(n) {
  return nzh.toMoney(n);
}
github trueai-org / module-shop-admin / src / utils / utils.js View on Github external
export function digitUppercase(n) {
  return nzh.toMoney(n);
}
github ZhiXiao-Lin / nestify / admin / src / utils / utils.js View on Github external
export function digitUppercase(n) {
  return nzh.toMoney(n);
}
github zhang8043 / abp-react-antd / Precise-Antd / src / utils / utils.js View on Github external
export function digitUppercase(n) {
  return nzh.toMoney(n);
}
github vellengs / nestx / packages / react / src / utils / utils.tsx View on Github external
export function digitUppercase(n: any) {
  return nzh.toMoney(n);
}
github hyperledger / cello / src / dashboard / src / utils / utils.js View on Github external
export function digitUppercase(n) {
  return nzh.toMoney(n);
}
github mojisrc / fashop-admin / src / utils / utils.js View on Github external
export function digitUppercase(n) {
  return nzh.toMoney(n);
}
github sishuguojixuefu / react-native-form / src / components / SsAmount.tsx View on Github external
import React, { Component } from 'react'
import { InputItem } from '@sishuguojixuefu/antd-mobile-rn'
import { View, Text, StyleSheet } from 'react-native'
import stringWidth from 'string-width'
import nzh from 'nzh'
import omit from 'lodash.omit'
import { SsAmountProps } from '../utils/PropTypes'
import getFieldDecorator from '../utils/getFieldDecorator'
import Label from './helper/Label'
import ErrorTip from './helper/ErrorTip'

const nzhCn = nzh.cn

export default class SsAmount extends Component {
  private fieldDecorator: any
  private chineseAmount = ''
  static defaultProps = {
    required: false,
    placeholder: '请输入',
    textAlign: 'right',
    upper: true,
  }

  componentWillMount() {
    const { form, id, initialValue, rules } = this.props
    const defaultStrValue = initialValue && initialValue.toString()
    this._getChineseAmount(defaultStrValue)
    this.fieldDecorator = getFieldDecorator(form, id, defaultStrValue, rules ? [...rules, 'money'] : ['money'])

nzh

数字转中文,大写,金额

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

65 / 100
Full package analysis

Popular nzh functions