(val interface{})
| 50 | } |
| 51 | |
| 52 | func FmtFloatFromInterface(val interface{}) float64 { |
| 53 | if val == nil { |
| 54 | return 0 |
| 55 | } |
| 56 | |
| 57 | switch ret := val.(type) { |
| 58 | case float64: |
| 59 | return ret |
| 60 | case float32: |
| 61 | return float64(ret) |
| 62 | default: |
| 63 | return 0 |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func FloatToString(val float64) string { |
| 68 | float, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", val), 64) |
nothing calls this directly
no outgoing calls
no test coverage detected