commit 02e77f41bd3d9eb10d5ad23c4879f2112a17cdc2 Author: Eduardo Silva Date: Wed Oct 1 23:18:27 2025 +0100 First commit with a very simple first function diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bdf7e0 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# UnitConv +Basic package to hold reusable unit conversion operations. + +Used mainly for my simracing projects so that's the scope of the unit conversions I need +here. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..cf88831 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/ESilva15/unitconv + +go 1.25.1 diff --git a/unitconv.go b/unitconv.go new file mode 100644 index 0000000..9c1ca96 --- /dev/null +++ b/unitconv.go @@ -0,0 +1,7 @@ +// Package unitconv provides useful unit conversions +package unitconv + +// MsToKph converts a float64 representing m/s to an int representing km/h +func MsToKph(v float32) int { + return int(3.6 * v) +}