Remove unused function

pull/396/head
Vladimir Volek 5 years ago
parent 885be491d0
commit 6b4b75005b

@ -10,15 +10,6 @@ describe('format utils', () => {
expect(utils.formatAmount(99999, { isBitcoin: false, shortcut: 'tau' }, null)).toBe('0.00099999 tau');
});
it('format time', () => {
expect(utils.formatTime(0)).toBe('No time estimate');
expect(utils.formatTime(1)).toBe('1 minutes'); // TODO: should be minute
expect(utils.formatTime(2)).toBe('2 minutes');
expect(utils.formatTime(45)).toBe('45 minutes');
expect(utils.formatTime(100)).toBe('1 hour 40 minutes');
expect(utils.formatTime(999)).toBe('16 hours 39 minutes'); // TODO: days, months ????
});
it('btckb2satoshib', () => {
expect(utils.btckb2satoshib(0)).toBe(0);
expect(utils.btckb2satoshib(1)).toBe(100000);

@ -14,25 +14,6 @@ export const formatAmount = (n: number, coinInfo: any, currencyUnits: string = c
return `${s} ${coinInfo.shortcut}`;
};
export const formatTime = (n: number): string => {
const hours = Math.floor(n / 60);
const minutes = n % 60;
if (!n) return 'No time estimate';
let res = '';
if (hours !== 0) {
res += `${hours} hour`;
if (hours > 1) {
res += 's';
}
res += ' ';
}
if (minutes !== 0) {
res += `${minutes} minutes`;
}
return res;
};
export const btckb2satoshib = (n: number): number => Math.round(n * 1e5);
export const stringToHex = (str: string): string => {

Loading…
Cancel
Save