I have a float, say 1762423.55, which I want to format as 1.76M, i.e. with three significant digits and with a SI prefix.
In Javascript this accessible with the s
type in d3.format
.
But in Python,
'{:s}'.format(1762423.55)
fails with a ValueError: Unknown format code 's' for object of type 'float'
.
Is the SI format accessible through another standard type format in Python? If not, where on GitHub should I ask for it?