Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
fe-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sunguoshu
fe-utils
Commits
561b58ab
Commit
561b58ab
authored
Jul 17, 2023
by
sunguoshu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充测试案例
parent
5909658f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
numberToWords.test.ts
test/money/numberToWords.test.ts
+57
-0
No files found.
test/money/numberToWords.test.ts
View file @
561b58ab
...
...
@@ -77,6 +77,63 @@ describe('测试整数', () => {
it
(
'1111 toBe 壹仟壹佰壹拾壹元整'
,
()
=>
{
expect
(
numberToWords
(
1111
)).
toBe
(
'壹仟壹佰壹拾壹元整'
)
})
it
(
'10000 toBe 壹万元整'
,
()
=>
{
expect
(
numberToWords
(
10000
)).
toBe
(
'壹万元整'
)
})
it
(
'10001 toBe 壹万零壹元整'
,
()
=>
{
expect
(
numberToWords
(
10001
)).
toBe
(
'壹万零壹元整'
)
})
it
(
'12345 toBe 壹万贰仟叁佰肆拾伍元整'
,
()
=>
{
expect
(
numberToWords
(
12345
)).
toBe
(
'壹万贰仟叁佰肆拾伍元整'
)
})
it
(
'100000 toBe 壹拾万元整'
,
()
=>
{
expect
(
numberToWords
(
100000
)).
toBe
(
'壹拾万元整'
)
})
it
(
'110000 toBe 壹拾壹万元整'
,
()
=>
{
expect
(
numberToWords
(
110000
)).
toBe
(
'壹拾壹万元整'
)
})
it
(
'1000001 toBe 壹佰万零壹元整'
,
()
=>
{
expect
(
numberToWords
(
1000001
)).
toBe
(
'壹佰万零壹元整'
)
})
it
(
'1100000 toBe 壹佰壹拾万元整'
,
()
=>
{
expect
(
numberToWords
(
1100000
)).
toBe
(
'壹佰壹拾万元整'
)
})
it
(
'1010000 toBe 壹佰零壹万元整'
,
()
=>
{
expect
(
numberToWords
(
1010000
)).
toBe
(
'壹佰零壹万元整'
)
})
it
(
'10000000 toBe 壹仟万元整'
,
()
=>
{
expect
(
numberToWords
(
10000000
)).
toBe
(
'壹仟万元整'
)
})
it
(
'10000001 toBe 壹仟万零壹元整'
,
()
=>
{
expect
(
numberToWords
(
10000001
)).
toBe
(
'壹仟万零壹元整'
)
})
it
(
'10010000 toBe 壹仟零壹万元整'
,
()
=>
{
expect
(
numberToWords
(
10010000
)).
toBe
(
'壹仟零壹万元整'
)
})
it
(
'10100000 toBe 壹仟零壹拾万元整'
,
()
=>
{
expect
(
numberToWords
(
10100000
)).
toBe
(
'壹仟零壹拾万元整'
)
})
it
(
'11000000 toBe 壹仟壹佰万元整'
,
()
=>
{
expect
(
numberToWords
(
11000000
)).
toBe
(
'壹仟壹佰万元整'
)
})
it
(
'100000000 toBe 壹亿元整'
,
()
=>
{
expect
(
numberToWords
(
100000000
)).
toBe
(
'壹亿元整'
)
})
it
(
'1000000000 toBe 壹拾亿元整'
,
()
=>
{
expect
(
numberToWords
(
1000000000
)).
toBe
(
'壹拾亿元整'
)
})
it
(
'10000000000 toBe 壹佰亿元整'
,
()
=>
{
expect
(
numberToWords
(
10000000000
)).
toBe
(
'壹佰亿元整'
)
})
it
(
'99999999999 toBe 玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元整'
,
()
=>
{
expect
(
numberToWords
(
99999999999
)).
toBe
(
'玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元整'
)
})
it
(
'90909090990 toBe玖佰零玖亿零玖佰零玖万零玖佰玖拾元整'
,
()
=>
{
expect
(
numberToWords
(
90909090990
)).
toBe
(
'玖佰零玖亿零玖佰零玖万零玖佰玖拾元整'
)
})
it
(
'100000000000 toBe 壹仟亿元整'
,
()
=>
{
expect
(
numberToWords
(
100000000000
)).
toBe
(
'壹仟亿元整'
)
})
it
(
'100010000.00 toBe 壹亿零壹万元'
,
()
=>
{
expect
(
numberToWords
(
100010000.0
)).
toBe
(
'壹亿零壹万元整'
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment