Golang : micron to centimeter example
Problem:
You need to convert centimeter to micron (µ) in Golang. How to do that?
Solution:
Simple. See the following code:
package main
import (
"fmt"
)
func micron2cm(µ float64) float64 {
return µ / 10000
}
func cm2micron(cm float64) float64 {
return cm * 10000
}
func main() {
fmt.Println("10 µ in centimeter is : ", micron2cm(10.0))
fmt.Println(micron2cm(10.0), " centimeter in µ :", cm2micron(micron2cm(10.0)))
}
Output:
10 µ in centimeter is : 0.001
0.001 centimeter in µ : 10
References:
http://www.allmeasures.com/Fullconversion.asp
https://socketloop.com/tutorials/golang-temperatures-conversion-example
See also : Golang : Temperatures conversion example
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+11k Golang : How to use if, eq and print properly in html template
+16.7k Golang : Get input from keyboard
+5.5k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error
+7.3k Golang : Rename part of filename
+4.4k Adding Skype actions such as call and chat into web page examples
+31.9k Golang : Math pow(the power of x^y) example
+11.6k Golang : Find and draw contours with OpenCV example
+36.1k Golang : Convert(cast) int64 to string
+5.7k AWS S3 : Prevent Hotlinking policy
+10.4k Android Studio : Checkbox for user to select options example
+8.5k Golang : Get final balance from bit coin address example