docs/content/en/methods/duration/Round.md
raw| 1 | --- |
| 2 | title: Round |
| 3 | description: Returns the result of rounding DURATION1 to the nearest multiple of DURATION2. |
| 4 | categories: [] |
| 5 | keywords: [] |
| 6 | params: |
| 7 | functions_and_methods: |
| 8 | returnType: |
| 9 | signatures: [DURATION1.Round DURATION2] |
| 10 | --- |
| 11 | |
| 12 | ```go-html-template |
| 13 | {{ $d = time.ParseDuration "3.5h2.5m1.5s" }} |
| 14 | |
| 15 | {{ $d.Round (time.ParseDuration "2h") }} → 4h0m0s |
| 16 | {{ $d.Round (time.ParseDuration "3m") }} → 3h33m0s |
| 17 | {{ $d.Round (time.ParseDuration "4s") }} → 3h32m32s |
| 18 | ``` |