Skip to content

Commit

Permalink
fix(neuron-ui): remove /s from difficulty units
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Nov 16, 2019
1 parent 53b13da commit 2a45e63
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
{ "difficulty": 0, "expected": "0 H/s" },
{ "difficulty": 123, "expected": "123 H/s" },
{ "difficulty": 12345, "expected": "12,345 H/s" },
{ "difficulty": 123454669, "expected": "123,454.67 KH/s" },
{ "difficulty": 1234546698945, "expected": "1,234.55 GH/s" },
{ "difficulty": 100003439, "expected": "100,003.44 KH/s" }
{ "difficulty": 0, "expected": "0 H" },
{ "difficulty": 123, "expected": "123 H" },
{ "difficulty": 12345, "expected": "12,345 H" },
{ "difficulty": 123454669, "expected": "123,454.67 KH" },
{ "difficulty": 1234546698945, "expected": "1,234.55 GH" },
{ "difficulty": 100003439, "expected": "100,003.44 KH" }
]
18 changes: 9 additions & 9 deletions packages/neuron-ui/src/utils/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ export const failureResToNotification = (res: any): State.Message => {

export const difficultyFormatter = (value: bigint) => {
const units = new Map([
['YH/s', 1e24],
['ZH/s', 1e21],
['EH/s', 1e18],
['PH/s', 1e15],
['TH/s', 1e12],
['GH/s', 1e9],
['MH/s', 1e6],
['KH/s', 1e3],
['YH', 1e24],
['ZH', 1e21],
['EH', 1e18],
['PH', 1e15],
['TH', 1e12],
['GH', 1e9],
['MH', 1e6],
['KH', 1e3],
])

/* eslint-disable no-restricted-syntax */
Expand All @@ -199,7 +199,7 @@ export const difficultyFormatter = (value: bigint) => {
}
/* eslint-enable no-restricted-syntax */

return `${localNumberFormatter(value)} H/s`
return `${localNumberFormatter(value)} H`
}

export default {
Expand Down

0 comments on commit 2a45e63

Please sign in to comment.