Groups
Groups
Sign in
Groups
Groups
ClojureScript
Conversations
About
Send feedback
Help
where is the format function
235 views
Skip to first unread message
Yehonathan Sharvit
unread,
Apr 30, 2014, 11:26:40 PM
4/30/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to clojur...@googlegroups.com
It seems that “format” has been removed from cljs.
It was added 2 years ago in
https://github.com/clojure/clojurescript/commit/8f518760a3df8b351208e97bb70270856623bb0a
Also, goog.string.format is not available any more.
My question is: what is the best way to add leading zeros in cljs?
Karel Miarka
unread,
Sep 12, 2016, 10:05:05 AM
9/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClojureScript
Have you already found the answer? Could you please share it?
Francis Avila
unread,
Sep 12, 2016, 10:46:41 AM
9/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClojureScript
goog.string.format definitely still exists:
http://google.github.io/closure-library/api/goog.string.format.html
goog.string also has many specialized formatting functions. For example, for leading zeros, use goog.string/padNumber:
http://google.github.io/closure-library/api/goog.string.html#padNumber
mars0i
unread,
Sep 12, 2016, 11:22:32 AM
9/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClojureScript
There's also cljs.pprint/cl-format, which is portable between Clojurescript and Clojure (there as clojure.pprint/cl-format).
Reply all
Reply to author
Forward
0 new messages