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.

Reply via email to