Documentation
¶
Index ¶
- Constants
- func BytesToGB(b int64) float64
- func BytesToKB(b int64) float64
- func BytesToMB(b int64) float64
- func CelsiusToFahrenheit(c float64) float64
- func CelsiusToKelvin(c float64) float64
- func DaysToHours(d int64) int64
- func FahrenheitToCelsius(f float64) float64
- func FahrenheitToKelvin(f float64) float64
- func GBToBytes(gb float64) int64
- func HoursToDays(h int64) float64
- func HoursToMinutes(h int64) int64
- func KBToBytes(kb float64) int64
- func KelvinToCelsius(k float64) float64
- func KelvinToFahrenheit(k float64) float64
- func MBToBytes(mb float64) int64
- func MinutesToHours(m int64) float64
- func MinutesToSeconds(m int64) int64
- func RoundToTwoDecimals(val float64) float64
- func SecondsToMinutes(s int64) float64
Constants ¶
const ( KiloByte = 1_024 MegaByte = 1_048_576 GigaByte = 1_073_741_824 )
Data size constants
const ( SecondsPerMinute = 60 MinutesPerHour = 60 HoursPerDay = 24 )
Time constants
const ( CelsiusFahrenheitOffset = 32 CelsiusToKelvinOffset = 273.15 FahrenheitToKelvinOffset = 459.67 CelsiusToFahrenheitFactor = 9.0 / 5.0 FahrenheitToCelsiusFactor = 5.0 / 9.0 )
Temperature constants
Variables ¶
This section is empty.
Functions ¶
func BytesToGB ¶
BytesToGB converts bytes to gigabytes It takes an integer value of bytes and returns the equivalent in gigabytes as a float64.
func BytesToKB ¶
BytesToKB converts bytes to kilobytes. It takes an integer value of bytes and returns the equivalent in kilobytes as a float64.
func BytesToMB ¶
BytesToMB converts bytes to megabytes. It takes an integer value of bytes and returns the equivalent in megabytes as a float64.
func CelsiusToFahrenheit ¶
CelsiusToFahrenheit converts Celsius to Fahrenheit. It takes a float64 value of Celsius and returns the equivalent in Fahrenheit as a float64.
func CelsiusToKelvin ¶
CelsiusToKelvin converts Celsius to Kelvin. It takes a float64 value of Celsius and returns the equivalent in Kelvin as a float64.
func DaysToHours ¶
DaysToHours converts days to hours. It takes an integer value of days and returns the equivalent in hours as an int64.
func FahrenheitToCelsius ¶
FahrenheitToCelsius converts Fahrenheit to Celsius. It takes a float64 value of Fahrenheit and returns the equivalent in Celsius as a float64.
func FahrenheitToKelvin ¶
FahrenheitToKelvin converts Fahrenheit to Kelvin. It takes a float64 value of Fahrenheit and returns the equivalent in Kelvin as a float64.
func GBToBytes ¶
GBToBytes converts gigabytes to bytes. It takes a float64 value of gigabytes and returns the equivalent in bytes as an int64.
func HoursToDays ¶
HoursToDays converts hours to days. It takes an integer value of hours and returns the equivalent in days as a float64.
func HoursToMinutes ¶
HoursToMinutes converts hours to minutes. It takes an integer value of hours and returns the equivalent in minutes as an int64.
func KBToBytes ¶
KBToBytes converts kilobytes to bytes. It takes a float64 value of kilobytes and returns the equivalent in bytes as an int64.
func KelvinToCelsius ¶
KelvinToCelsius converts Kelvin to Celsius. It takes a float64 value of Kelvin and returns the equivalent in Celsius as a float64.
func KelvinToFahrenheit ¶
KelvinToFahrenheit converts Kelvin to Fahrenheit. It takes a float64 value of Kelvin and returns the equivalent in Fahrenheit as a float64.
func MBToBytes ¶
MBToBytes converts megabytes to bytes. It takes a float64 value of megabytes and returns the equivalent in bytes as an int64.
func MinutesToHours ¶
MinutesToHours converts minutes to hours. It takes an integer value of minutes and returns the equivalent in hours as a float64.
func MinutesToSeconds ¶
MinutesToSeconds converts minutes to seconds. It takes an integer value of minutes and returns the equivalent in seconds as an int64.
func RoundToTwoDecimals ¶
RoundToTwoDecimals is deprecated; rounds a float64 value to two decimal places. Deprecated: Use `math.RoundDecimalPlaces(val float64, places int) float64` in the math-utils package instead.
func SecondsToMinutes ¶
SecondsToMinutes converts seconds to minutes. It takes an integer value of seconds and returns the equivalent in minutes as a float64.
Types ¶
This section is empty.