Skip to content

Commit

Permalink
Add Seconds/Milliseconds methods to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Jun 9, 2024
1 parent c986eae commit b443f17
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions styles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,23 @@ This function returns a string representation of the given HSLA color.
hslaColor := styles.HSLA(120, 100, 50, 0.5) // Returns "hsla(120, 100%, 50%, 0.5)"
```

#### Time Duration Functions

##### `Seconds(value float64) string`

This function returns a string representation of the given time duration in seconds.

```go
secondsValue := styles.Seconds(2.5) // Returns "2.5s"
```

##### `Milliseconds(value int) string`

This function returns a string representation of the given time duration in milliseconds.

```go
millisecondsValue := styles.Milliseconds(500) // Returns "500ms"
```

#### Other Functions

Expand Down

0 comments on commit b443f17

Please sign in to comment.