frequi_origin/src/shared/formatters.js

20 lines
361 B
JavaScript
Raw Normal View History

2020-06-05 09:22:14 +00:00
import moment from 'moment';
2020-06-02 11:05:16 +00:00
export function formatPercent(value) {
return value ? `${(value * 100).toFixed(3)}%` : '';
2020-06-02 11:05:16 +00:00
}
export function formatPrice(value) {
return value ? value.toFixed(8) : '';
}
2020-06-05 09:22:14 +00:00
export function timestampms(ts) {
return moment(ts).format('YYYY-MM-DD hh:mm:ss');
}
export default {
formatPrice,
formatPercent,
2020-06-05 09:22:14 +00:00
timestampms,
};