format

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package format is used to format currencies.

Can be used to format currencies as string or as a float64 with the correct precision.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(currencyCode string, value float64) (string, error)

Format converts currency to a string with correct symbol and precision.

func FormatAs

func FormatAs(currencyCode string, value float64, strFormat string) (string, error)

FormatAs converts currency to a string with correct symbol and precision according to specified format string. %v is used for value, %s is used for currency symbol

func Round

func Round(currencyCode string, value float64) (float64, error)

Round returns a float64 with the precision for the currency specified.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL