Float64 handles encoding of 64bit float values according to the ValueEncoder configuration.
(field string, val float64)
| 152 | |
| 153 | // Float64 handles encoding of 64bit float values according to the ValueEncoder configuration. |
| 154 | func (m *ValueEncoder) Float64(field string, val float64) string { |
| 155 | |
| 156 | var ( |
| 157 | result string |
| 158 | sum = m.GetSummary(TypeNumeric, field) |
| 159 | ) |
| 160 | |
| 161 | switch { |
| 162 | case m.conf.ZScore: |
| 163 | result = ZScore(val, sum) |
| 164 | case m.conf.MinMax: |
| 165 | result = MinMax(val, sum) |
| 166 | default: |
| 167 | spew.Dump(m.conf) |
| 168 | log.Fatal("invalid config: no normalization strategy") |
| 169 | } |
| 170 | |
| 171 | return result |
| 172 | } |
| 173 | |
| 174 | // GetSummary returns the summary for the given column type and field name. |
| 175 | // It will create a new one if none is being tracked yet. |