Esempio n. 1
0
func (c MathUtil) Add(str1 string, str2 string) string {
	dec1 := dec.Dec{}
	dec1.SetString(str1)
	dec2 := dec.Dec{}
	dec2.SetString(str2)

	result := dec.Dec{}
	result.Add(&dec1, &dec2)
	return result.String()
}
Esempio n. 2
0
/**
return x / y
*/
func (c MathUtil) Quo(str1 string, str2 string, scaler dec.Scaler, rounder dec.Rounder) string {
	dec1 := dec.Dec{}
	dec1.SetString(str1)
	dec2 := dec.Dec{}
	dec2.SetString(str2)

	result := dec.Dec{}
	result.Quo(&dec1, &dec2, scaler, rounder)
	return result.String()
}