Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
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,
}