-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coin2html: thousands separator, d3 slimming
- Loading branch information
Showing
9 changed files
with
33,538 additions
and
229,904 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
import { Commodity } from "../src/commodity"; | ||
import { Amount, Commodity } from "../src/commodity"; | ||
|
||
test("create commodity", () => | ||
expect(new Commodity("CAD", "Canadian Dollar", 2, "")).toBeTruthy()); | ||
|
||
describe("amount", () => { | ||
const CAD = new Commodity("CAD", "Canadian Dollar", 2, ""); | ||
test.each([ | ||
[0, "0.00 CAD"], | ||
[1, "0.01 CAD"], | ||
[-1, "-0.01 CAD"], | ||
[200, "2.00 CAD"], | ||
[-50, "-0.50 CAD"], | ||
[123456789, "1,234,567.89 CAD"], | ||
[-12345678, "-123,456.78 CAD"], | ||
])(`%#: %i`, (i, expected) => { | ||
const amt = new Amount(i, CAD); | ||
expect(amt.toString()).toBe(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.