Skip to content

theTardigrade/golang-ordersOfMagnitude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang-ordersOfMagnitude

This package exposes a single function, Name, which describes the order of magnitude of a number.

Go Report Card

Example

package main

import (
	"fmt"

	ordersOfMagnitude "github.com/theTardigrade/golang-ordersOfMagnitude"
)

func main() {
	const exampleNumber = 12_345_678_912

	fmt.Printf(
		"The number %d has an order of magnitude in the %s.\n",
		exampleNumber,
		ordersOfMagnitude.Name(exampleNumber),
	)
}

Running the example code above should produce the following output:

The number 12345678912 has an order of magnitude in the tens of billions.

About

This Go package determines the order of magnitude of a number.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages