mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-14 12:13:52 +00:00
14 lines
513 B
TypeScript
14 lines
513 B
TypeScript
import { formatPercent, formatPriceCurrency } from '@/shared/formatters';
|
|
|
|
describe('formatters.ts', () => {
|
|
it('Format percent correctly', () => {
|
|
expect(formatPercent(0.5)).toEqual('50.000%');
|
|
});
|
|
|
|
it('format price currency as expected', () => {
|
|
expect(formatPriceCurrency(5123.551123, 'USDT', 3)).toEqual('5123.551 USDT');
|
|
expect(formatPriceCurrency(5123.551123, 'USDT')).toEqual('5123.551 USDT');
|
|
expect(formatPriceCurrency(5123.551123, 'USDT', 5)).toEqual('5123.55112 USDT');
|
|
});
|
|
});
|