package mhayaUtils

import (
	"github.com/shopspring/decimal"
)

func Float64ByRatioToInt64(f float64, i int64) int64 {
	a := decimal.NewFromFloat(f)
	b := decimal.NewFromInt(i)
	return a.Mul(b).IntPart()
}

func QuoInt64ByRatioToFloat64(f, i int64) float64 {
	a := decimal.NewFromInt(f)
	b := decimal.NewFromInt(i)
	return a.Div(b).InexactFloat64()
}
