How to convert negative integers to strings in SML with minus sign instead of tilde?
Asked 2011-11-19T07:09:00.107
15
The standard SML library function Int.toString prefixes negative numbers with ~ instead of -. Is there a library function to use - instead, short of writing
fun i2s i =
if i < 0 then "-" ^ Int.toString (~i) else Int.toString i