Converts untyped value into float. The bool return implies success - it returns false only if there is a conversion failure.
()
| 681 | // Converts untyped value into float. The bool return implies success |
| 682 | // - it returns false only if there is a conversion failure. |
| 683 | func (v Value) bytesToFloat() (float64, bool) { |
| 684 | bytes, _ := v.ToBytes() |
| 685 | i, err := strconv.ParseFloat(strings.TrimSpace(string(bytes)), 64) |
| 686 | return i, err == nil |
| 687 | } |
| 688 | |
| 689 | // Converts untyped value into bool. The second bool return implies |
| 690 | // success - it returns false in case of a conversion failure. |