This seems to be obvious, but how do you convert the Clojure relation type to percent?
(format "%3s" (/ 1 2)) ;; "1/2" (format "%3f" (/ 1 2)) ;; Throws an error
You can always convert to Float:
Float
(format "%3f" (float (/ 1 2)))
cl-format, which is derived from Common Lisp format, is more flexible than Java-based Clojure formatin some situations:
cl-format
format
(require 'clojure.pprint) (clojure.pprint/cl-format nil "~f" (/ 1 2)) ;=> "0.5"
Must read source:
(.decimalValue (/ 1 2))
does what i need.
Source: https://habr.com/ru/post/1599692/More articles:Невозможно подключиться к любому из указанных узлов MySQL - соединитель MySQL 6.8.3 и ASP MVC5 - asp.net-mvcПолучать файлы и другую информацию об активах без полной загрузки в память - iostarget указывает тип продукта "com.apple.product-type.watchkit2-extension", но нет такого типа продукта для платформы "iphonesimulator" - iosC ++ long double print all digits with precision - c ++Is it possible to access the Hbase installed inside the docker container, which can be accessed using the java client on Mac OSX? - dockerWhy javascript accepts decimal as integer - javascriptConfirm input type in do-while loop C - cKarma does not work when using PhantomJS, but not in Chrome - javascriptWhy is this recursion much faster than equivalent iteration? - c ++An external style bleeds into my polymer component local DOM - cssAll Articles