formatCountChange formats the absolute change in a count value (e.g. "+3", "-1")
(count1, count2 int)
| 42 | |
| 43 | // formatCountChange formats the absolute change in a count value (e.g. "+3", "-1") |
| 44 | func formatCountChange(count1, count2 int) string { |
| 45 | delta := count2 - count1 |
| 46 | if delta >= 0 { |
| 47 | return fmt.Sprintf("+%d", delta) |
| 48 | } |
| 49 | return strconv.Itoa(delta) |
| 50 | } |
| 51 | |
| 52 | // formatFloatDelta formats an absolute delta between two floating-point values. |
| 53 | func formatFloatDelta(value1, value2 float64) string { |
no outgoing calls