NumberFormatsΒΆ

outform.spad line 2 [edit on github]

NumberFormats provides function to format and read arabic and roman numbers, to convert numbers to strings and to read floating-point numbers.

FormatArabic: PositiveInteger -> String

FormatArabic(n) forms an Arabic numeral string from an integer n.

FormatRadix: (Integer, Integer) -> String

FormatRadix(n, r) forms a string from an integer n in radix r.

FormatRoman: PositiveInteger -> String

FormatRoman(n) forms a Roman numeral string from an integer n.

ScanArabic: String -> PositiveInteger

ScanArabic(s) forms an integer from an Arabic numeral string s.

ScanFloatIgnoreSpaces: String -> Float

ScanFloatIgnoreSpaces(s) forms a floating point number from the string s ignoring any spaces. Error is generated if the string is not recognised as a floating point number.

ScanFloatIgnoreSpacesIfCan: String -> Union(Float, failed)

ScanFloatIgnoreSpacesIfCan(s) tries to form a floating point number from the string s ignoring any spaces.

ScanRoman: String -> PositiveInteger

ScanRoman(s) forms an integer from a Roman numeral string s.