Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
haimkastner committed Dec 3, 2024
1 parent 0fe3335 commit 9539ec8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: unitsnet-py
name: unitsnet-go

on: [push, workflow_dispatch]

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@ import (
func main() {

// Create a factory instance
af := unitsnet_go.AngleFactory{}
af := unitsnet_go.AngleFactory{}
angle, _ := af.FromDegrees(180)
// equals to
angle, _ := af.CreateAngle(180, unitsnet_go.AngleDegree)
angle, _ := af.CreateAngle(180, unitsnet_go.AngleDegree)

log.Println(angle.Radians()) // 3.141592653589793
log.Println(angle.Microradians()) // 3141592.65358979
log.Println(angle.Gradians()) // 200
log.Println(angle.Microdegrees()) // 180000000
log.Println(angle.Microradians()) // 3141592.65358979
log.Println(angle.Gradians()) // 200
log.Println(angle.Microdegrees()) // 180000000

// As an alternative, a convert style method are also available
log.Println(angle.Convert(unitsnet_go.AngleRadian)) // 3.141592653589793
log.Println(angle.Convert(unitsnet_go.AngleMicroradian)) // 3141592.65358979
log.Println(angle.Convert(unitsnet_go.AngleGradian)) // 200
log.Println(angle.Convert(unitsnet_go.AngleMicrodegree)) // 180000000
log.Println(angle.Convert(unitsnet_go.AngleRadian)) // 3.141592653589793
log.Println(angle.Convert(unitsnet_go.AngleMicroradian)) // 3141592.65358979
log.Println(angle.Convert(unitsnet_go.AngleGradian)) // 200
log.Println(angle.Convert(unitsnet_go.AngleMicrodegree)) // 180000000

// Print the default unit to_string (The default for angle is degrees)
log.Println(angle) // 180.00 °
log.Println(angle) // 180.00 °

// Specify unit and fraction digits max length
log.Println(angle.ToString(unitsnet_go.AngleDegree, 0)) // 180 °
log.Println(angle.ToString(unitsnet_go.AngleRadian, 3)) // 3.141 rad
log.Println(angle.ToString(unitsnet_go.AngleRadian, 3)) // 3.141 rad
}

```
Expand Down

0 comments on commit 9539ec8

Please sign in to comment.