MathNya / umya-spreadsheet

A pure rust library for reading and writing spreadsheet files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output number to String

ziyouwa opened this issue · comments

let a = "000001".to_string(),

tyied these:
sheet.get_cell_mut("B1").set_value(format!("{:0>6}", a.b)); // only 1
sheet.get_cell_mut("B1").set_value(a.b.clone()); //only 1
sheet.get_cell_mut("B1").set_value(&a.b); // only1

when output it to file, only display 1. How to display 000001 as txt?

you can use set_value_string instead of set_value

you can use set_value_string instead of set_value

Thanks!