From 93c6cf623eed703b086aef550198a24d7ccffe06 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sat, 19 Mar 2016 11:43:50 -0600 Subject: [PATCH] mention %j specifier in readme --- Readme.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index ed516e6..027aa82 100644 --- a/Readme.md +++ b/Readme.md @@ -31,16 +31,21 @@ Usage vsprintf('%d is the answer to %s', [42, what]) // => '42 is the answer to life, the universe, and everything' -Supported format specifiers: b, c, d, f, o, s, x, and X. + // you can format values as JSON with %j + var value = {answer: 42} + format('%j', value) + // => '{"answer":42}' -See `man 3 printf` or `man 1 printf` for details. +Supported format specifiers: b, c, d, f, j, o, s, x, and X. + +See `man 3 printf` or `man 1 printf` for details. `j` is an extension that formats values as JSON. Precision is supported for floating point numbers. License ======= -Copyright 2010 - 2014 Sami Samhuri sami@samhuri.net +Copyright 2010 - 2016 Sami Samhuri sami@samhuri.net [MIT license](http://sjs.mit-license.org)