Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromWei ¶
FromWei transforms wei to a decimal value with `decimals` orders of magnitude (divide by 10^`decimals`)
func RenderFloat ¶
RenderFloat is a Go function to render a number to a string based on the following user-specified criteria: * thousands separator * decimal separator * decimal precision Usage: s := RenderFloat(format, n) The format parameter tells how to render the number n. http://play.golang.org/p/LXc1Ddm1lJ Examples of format strings, given n = 12345.6789: "#,###.##" => "12,345.67" "#,###." => "12,345" "#,###" => "12345,678" "#\u202F###,##" => "12 345,67" "#.###,###### => 12.345,678900 "" (aka default format) => 12,345.67 The highest precision allowed is 9 digits after the decimal symbol. There is also a version for integer number, RenderInteger(), which is convenient for calls within template. I didn't feel it was worth to publish a library just for this piece of code, hence the snippet. Feel free to reuse as you wish.
func RenderInteger ¶
RenderInteger is a convenient function to format integers, see RenderFloat
func SliceToBytes32 ¶
SliceToBytes32 transforms a []byte to a [32]byte
Types ¶
This section is empty.