Repository URL to install this package:
|
Version:
2.1.0 ▾
|
import { fromIshToNumber, fromIshToString } from 'exotic'
function toValidHTML(html: string) {
return fromIshToString(html)
}
function convertAsPrice(price: string | number) {
const trimPrice = fromIshToString(price + '')
if (trimPrice) {
const priceAsNumber = '$' + fromIshToNumber(trimPrice)
return priceAsNumber + ((priceAsNumber.indexOf('.') === -1) ? '.00' : '')
}
return trimPrice
}
export {
toValidHTML,
convertAsPrice,
}