test: use gpt-oss-20b to do some minor refactoring

This commit is contained in:
Edward Langley
2026-03-31 22:50:07 -07:00
parent bbfd2dc163
commit bbd1f48b78
2 changed files with 28 additions and 14 deletions

View File

@ -291,7 +291,7 @@ impl<'a> GridWidget<'a> {
};
let value = self.model.evaluate(&key);
let cell_str = format_value(value.as_ref(), fmt_comma, fmt_decimals);
let cell_str = format_cell_value(value.as_ref(), &view.number_format);
let is_selected = ri == sel_row && ci == sel_col;
let is_search_match = !self.search_query.is_empty()
&& cell_str
@ -435,7 +435,7 @@ impl<'a> Widget for GridWidget<'a> {
}
}
fn format_value(v: Option<&CellValue>, comma: bool, decimals: u8) -> String {
pub fn format_value(v: Option<&CellValue>, comma: bool, decimals: u8) -> String {
match v {
Some(CellValue::Number(n)) => format_f64(*n, comma, decimals),
Some(CellValue::Text(s)) => s.clone(),
@ -443,6 +443,11 @@ fn format_value(v: Option<&CellValue>, comma: bool, decimals: u8) -> String {
}
}
fn format_cell_value(v: Option<&CellValue>, fmt: &str) -> String {
let (comma, decimals) = parse_number_format(fmt);
format_value(v, comma, decimals)
}
pub fn parse_number_format(fmt: &str) -> (bool, u8) {
let comma = fmt.contains(',');
let decimals = fmt