MCPcopy
hub / github.com/chubin/wttr.in / parseInt

Function parseInt

internal/renderer/v1/helpers.go:11–20  ·  view source on GitHub ↗

Safe parsing helpers

(s string)

Source from the content-addressed store, hash-verified

9
10// Safe parsing helpers
11func parseInt(s string) int {
12 if s == "" {
13 return 0
14 }
15 i, err := strconv.Atoi(s)
16 if err != nil {
17 return 0
18 }
19 return i
20}
21
22func parseFloat32(s string) float32 {
23 if s == "" {

Callers 4

ConvertWeatherFunction · 0.85
convertCondFromCurrentFunction · 0.85
convertCondFromHourlyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected