Golang: Round Float64 Correctly

I need to implement the following "round up" function in GOLANG:

func roundFloat64 (x float64, decimals int) float64 {...}

Examples for testing:

roundFloat64 (1.111111111,8) = 1.11111112

roundFloat64 (1.1001,2) = 1.11

roundFloat64 (1.1000000000001,2) = 1.11

roundFloat64 (1.1000000000001,3) = 1,101

roundFloat64 (1.12345678,4) = 1.1235

Kemahiran: Golang

Lihat lagi: math.round golang, golang float64 to int, golang round float to 2 decimal places, golang round 2 decimals, golang math.round undefined, golang json float64 precision, golang round up int, golang round float to precision

Tentang Majikan:
( 3 ulasan ) Recife, Brazil

ID Projek: #18132096

Dianugerahkan kepada:


Hi I have 6+ experience in Golang. I can finish this job very easily in an hour. We can discuss more about this in private chat. Thanks Anoop S

$25 USD dalam sehari
(7 Ulasan)

2 pekerja bebas membida secara purata $20 untuk pekerjaan ini


Hi , I read your description and I can do that.I have 2+ years of experience in Golang . Contact me for the discussion

$15 USD dalam sehari
(0 Ulasan)