Cast general numeric cell into text
- From: Mike Toews <mwtoews sfu ca>
- To: gnumeric-list gnome org
- Subject: Cast general numeric cell into text
- Date: Tue, 03 Jun 2008 10:35:26 -0700
Hi,
I'm hoping to get some incite as to how I can convert a cell with
floating point contents (numeric) formatted as "General" to an exact
displayed text (i.e., string) for that cell. This isn't as easy as it
should be, since it is dependent on several factors such as cell width
and font size.
For example: in a fresh sheet put "22.654654378" into one cell, and
resize the cell back to 64px width. The cell now shows "22.6547". How
can I capture that into text? If I use (e.g.,) =text(A1,"General") then
I get the exact value typed originally, and not the displayed value.
Note that I'm actually developing some code to pull this data from old
spreadsheets into a database, but I don't know how to reverse-engineer
what MS have done with the general formatting. I'd like to keep the
original and displayed formatting from this data (i.e, I'd rather have
the text "0.2986" as displayed rather than "0.29861111111111099", also
in my situation, the number of decimals change for each row—some use
numeric formatting that I can use directly, and other cells use
"General" which require this assistance—very messy). Gnumeric reproduces
this behavior perfectly, so I'm hoping someone who knows whats ticking
beneath may be able to help me.
Thanks!
+mt
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]