price

package
v0.0.0-...-b1bd2f5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package price implements functions to ease working with stellar price values. At present, prices are only used within the offer system, and are represented by a fraction whose numberator and denominator are both 32-bit signed integers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(v string) (xdr.Price, error)

Parse calculates and returns the best rational approximation of the given real number price while still keeping both the numerator and the denominator of the resulting value within the precision limits of a 32-bit signed integer..

func StringFromFloat64

func StringFromFloat64(v float64) string

StringFromFloat64 will format a float64 to decimal representation with 7 digits after the decimal point

Types

This section is empty.

Jump to

Keyboard shortcuts

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