Skip to content

Commit 164d7d6

Browse files
remove format value from alert output
1 parent ef52f9c commit 164d7d6

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/alerts/alerts_utils.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async fn update_alert_state(
185185
alert.id,
186186
alert.threshold_config.operator,
187187
alert.threshold_config.value,
188-
format_number(actual_value),
188+
actual_value,
189189
alert.get_eval_window(),
190190
alert.get_eval_frequency(),
191191
alert.query
@@ -204,23 +204,6 @@ async fn update_alert_state(
204204
}
205205
}
206206

207-
/// Format a number for better readability
208-
fn format_number(value: f64) -> String {
209-
if value.fract() == 0.0 {
210-
// Integer value
211-
format!("{:.0}", value)
212-
} else if value.abs() < 1.0 {
213-
// Small decimal, show more precision
214-
format!("{:.4}", value)
215-
.trim_end_matches('0')
216-
.trim_end_matches('.')
217-
.to_string()
218-
} else {
219-
// Regular decimal, show 2 decimal places
220-
format!("{:.2}", value)
221-
}
222-
}
223-
224207
fn get_final_value(records: Vec<RecordBatch>) -> f64 {
225208
trace!("records-\n{records:?}");
226209

0 commit comments

Comments
 (0)