Liking cljdoc? Tell your friends :D
Clojure only.

utilities-clj.format

Type conversion to string using a custom format.

Type conversion to string using a custom format.
raw docstring

double-to-strclj

(double-to-str value digits)

Formats a string from a floating-point number. Value is converted to string with the number of decimal places equal to digits. Formatting is independent from locale with point used as decimal separator. Returns string in the floating-point format: +-?[0-9]+

Usage

(require '[utilities.format :refer :all])

(double-to-str 1.9 4)
=> "1.9000"

(double-to-str -45.688 2)
=> "-45.69"

(double-to-str +45.688 2)
=> "45.69"
Formats a string from a floating-point number. Value is converted
to string with the number of decimal places equal to digits. Formatting
is independent from locale with point used as decimal separator.
Returns string in the floating-point format: [+-]([0-9]*[.])?[0-9]+

## Usage

    (require '[utilities.format :refer :all])

    (double-to-str 1.9 4)
    => "1.9000"

    (double-to-str -45.688 2)
    => "-45.69"

    (double-to-str +45.688 2)
    => "45.69"
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close