You can use github.com/robaho/fixed :)

> On Jan 25, 2020, at 11:40 PM, Jamil Djadala <djad...@datamax.bg> wrote:
> 
> On Sat, 25 Jan 2020 19:14:15 -0800 (PST)
> "Jason E. Aten" <j.e.a...@gmail.com> wrote:
> 
>> 
>> https://play.golang.org/p/87bDubJxjHO
>> 
>> I'd like to truncate a float64 to just 2 decimal places (in base 10),
>> but math.Trunc is not helping me here... ideally I put 0.29 in and I
>> get 0.29 out.
>> Suggestions?  Playground examples appreciated.
> 
> you can use int types:
> https://play.golang.org/p/qLnynemd3S1
> -- 
> Jamil Djadala
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/20200126074011.0f17b4fa%40wolf.home.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4FB8D934-4C40-49D1-B748-4F2051C04B8C%40ix.netcom.com.

Reply via email to