String-Format-Full
View this project on npmjs.org
Use via NPM:
- Install:
npm install string-format-full
- Import:
import format from "string-format-full"
- Call:
const pi = format("{} is {:0.2f}", "Pi", 3.1415)
or
format.setOptions({global: true})
const pi = "{} is {:0.2f}".format("Pi", 3.1415)
Use Standalone:
- Download:
Grab a file
- Include:
<script src="index.IE11.min.js"></script>
- Call:
const pi = format("{} is {:0.2f}", "Pi", 3.1415)
or
format.setOptions({global: true})
const pi = "{} is {:0.2f}".format("Pi", 3.1415)
A few examples: