Elisp: Convert Number, String
Convert Integer to Float
;; int to float (float 3) ; 3.0
Convert Float to Integer
(truncate 3.3) ; 3
(floor 3.3) ; 3
(ceiling 3.3) ; 4
(round 3.4) ; 3
Convert String and Number
(string-to-number "3") (number-to-string 3) (format "%d" 3) ;; same as number-to-string but can also do format
〔see Elisp: Format String〕