Skip to content

Commit

Permalink
修正 rule.as.integer 生成的数据错乱的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Sep 20, 2024
1 parent 35228ec commit b3df868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/editorTable/excel/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ const as = {
* @returns
*/
number: (defaultValue?: number) => {
return new AsRule<number>(parseFloat).default(defaultValue);
return new AsRule<number>((value) => parseFloat(value)).default(defaultValue);
},
/**
* 将值视为整数
*/
integer: (defaultValue?: number) => {
return new AsRule<number>(parseInt).default(defaultValue);
return new AsRule<number>((value) => parseInt(value)).default(defaultValue);
},
/**
* 将值视为字符串。
Expand Down

0 comments on commit b3df868

Please sign in to comment.