Skip to content

Instantly share code, notes, and snippets.

@marwan-nwh
Created July 28, 2022 13:06
Show Gist options
  • Save marwan-nwh/3442d35e1c304685f810a753776e6c26 to your computer and use it in GitHub Desktop.
Save marwan-nwh/3442d35e1c304685f810a753776e6c26 to your computer and use it in GitHub Desktop.
let netpaymentInWords = i18n
.spellOut({ number: Number(netpayment), locale: "en" })
.toLowerCase();
if (netpaymentInWords.indexOf("point") > -1) {
netpaymentInWords =
netpaymentInWords.replace("point", "saudi riyal point") +
" halala only.";
} else {
netpaymentInWords += " saudi riyal only.";
}
netpaymentInWords = netpaymentInWords.toUpperCase();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment