mirror of
https://github.com/cupcakearmy/obolus.git
synced 2024-12-23 08:36:26 +00:00
15 lines
390 B
React
15 lines
390 B
React
|
import React from 'react'
|
||
|
import { Duration } from 'uhrwerk'
|
||
|
|
||
|
|
||
|
export const timePassedSinceTimestamp = since => new Duration(Date.now() - since, 'milliseconds').humanize() + ' ago'
|
||
|
|
||
|
export const formatPrice = price => {
|
||
|
const [int, float] = price.toFixed(2).split('.')
|
||
|
return <span className={'mr-1'}>
|
||
|
<b>{int}
|
||
|
<small>,{float}</small>
|
||
|
</b>
|
||
|
</span>
|
||
|
}
|