'Github is %s'.format('awesome'); // "Github is awesome" 'One answer may be %i'.format(42); // "One answer may be 42" 'Another answer may be %.5f'.format(Math.PI); // "Another answer may be 3.14159" '%.5f is not equal to %.5f'.format(22/7, Math.PI); // "3.14286 is not equal to 3.14159" 'PI minus 3 is %0.5f'.format(Math.PI - 3); // "PI minus 3 is 0.14159" '%,d is a really big number'.format(299792458); // "299,792,458 is a really big number" '%0,2f is a smaller number'.format(12021.12); // "12,021.12 is a smaller number"
References :
https://github.com/jsoverson/string-format
Keywords :
String , Format