updated 变量复用

This commit is contained in:
PASSER-BY 2022-11-27 00:18:26 +08:00
parent 7a0911d27d
commit 5fc7d649a9
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,11 +2,12 @@
* 数值转换 * 数值转换
*/ */
var textAttr = ['','一','二','三','四','五','六','七','八','九','十'];
// 中文数字转阿拉伯数字 // 中文数字转阿拉伯数字
export function zh2number(text){ export function zh2number(text){
var num = 0; var num = 0;
var map = {'大':1,'小':99}; var map = {'大':1,'小':99};
var textAttr = ['','一','二','三','四','五','六','七','八','九','十'];
if(map[text]){ if(map[text]){
num = map[text]; num = map[text];
}else{ }else{
@ -20,7 +21,6 @@ export function zh2number(text){
export function number2zh(num){ export function number2zh(num){
var text = ''; var text = '';
var map = {1:'大',99:'小'}; var map = {1:'大',99:'小'};
var textAttr = ['','一','二','三','四','五','六','七','八','九','十'];
if(map[num]){ if(map[num]){
text = map[num]; text = map[num];
}else{ }else{