Is there a function like number -> String
in Elm which formats number to String
? Not looking for specific Int
or Float
type but a general converting function for "typeclass" number
.
No.
Generally the number
typeclass exists mostly so that mathematical operators work for both Int
and Float
. I would recommend not trying to program generically against number
in your own code, but just pick the appropriate one (that's usually Float
, unless you're counting).