func precision(val float64, pre int) float64 {
	div := math.Pow10(pre)
	return float64(int64(val*div)) / div
}
precision | a helper function to set precision of price
package faker
import (
	"fmt"
	"math"
	"math/rand"
	"reflect"
)
var currencies = []string{
	"AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG",
	"AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND",
	"BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD",
	"CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU",
	"CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD",
	"EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS",
	"GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG",
	"HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD",
	"JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD",
	"KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL",
	"MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK",
	"MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR",
	"NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG",
	"QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG",
	"SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC",
	"SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD",
	"TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW",
	"UZS", "VES", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA",
	"XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT",
	"XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL",
}
type Money interface {
	Currency(v reflect.Value) (interface{}, error)
	Amount(v reflect.Value) (interface{}, error)
	AmountWithCurrency(v reflect.Value) (interface{}, error)
}
type Price struct {
}
var pri Money
func GetPrice() Money {
	mu.Lock()
	defer mu.Unlock()
	if pri == nil {
		pri = &Price{}
	}
	return pri
}
func SetPrice(p Money) {
	pri = p
}
func (p Price) currency() string {
	return randomElementFromSliceString(currencies)
}
func (p Price) Currency(v reflect.Value) (interface{}, error) {
	return p.currency(), nil
}
func Currency() string {
	return singleFakeData(CurrencyTag, func() interface{} {
		p := Price{}
		return p.currency()
	}).(string)
}
func (p Price) amount() float64 {
	return precision(rand.Float64()*math.Pow10(rand.Intn(8)), rand.Intn(2)+1)
}
func (p Price) Amount(v reflect.Value) (interface{}, error) {
	kind := v.Kind()
	val := p.amount()
	if kind == reflect.Float32 {
		v.Set(reflect.ValueOf(float32(val)))
		return float32(val), nil
	}
	v.Set(reflect.ValueOf(val))
	return val, nil
}
func (p Price) amountwithcurrency() string {
	val := p.amount()
	return fmt.Sprintf("%s %f", p.currency(), val)
}
func (p Price) AmountWithCurrency(v reflect.Value) (interface{}, error) {
	return p.amountwithcurrency(), nil
}
func AmountWithCurrency() string {
	return singleFakeData(AmountWithCurrencyTag, func() interface{} {
		p := Price{}
		return p.amountwithcurrency()
	}).(string)
}