umya-spreadsheet icon indicating copy to clipboard operation
umya-spreadsheet copied to clipboard

Number Formats ignore literal strings and characters

Open redfire75369 opened this issue 1 year ago • 2 comments

If a number format like "0\ 0" is provided, the space in the middle is ignored.

Code:

let mut wb = new_file();
let sheet = wb.get_sheet_mut(&0).unwrap();
sheet.get_cell_mut("A1").set_value("12");
sheet.get_style_mut("A1")
        .get_number_format_mut()
        .set_format_code("#\\ #");
println!("{:#?}", sheet.get_formatted_value("A1"));

Expected Output: "1 2" Actual Output: "12"

I believe the problematic code is here: https://github.com/MathNya/umya-spreadsheet/blob/f53f841b60266f49551b2b9bdd6b279ea363c3a9/src/helper/number_format.rs#L444-L454

redfire75369 avatar Oct 04 '24 00:10 redfire75369

@Redfire75369 Thank you for contacting us. We will review the situation and correct it.

MathNya avatar Oct 07 '24 01:10 MathNya

@Redfire75369 Sorry, the process here is quite complex and will take time to correct.

MathNya avatar Oct 11 '24 02:10 MathNya