Discussion:
[GTALUG] An LibreOffice question.
Alvin Starr via talk
2018-07-30 19:46:55 UTC
Permalink
Does anybody know how to display and work with SI numbers like 10k or
20M or 40G within LIbreOffice?

I have had little luck searching with google et al.

While I am at it how about engineering notation?
--
Alvin Starr || land: (905)513-7688
Netvel Inc. || Cell: (416)806-0133
***@netvel.net ||

---
Talk Mailing List
***@gtalug.org
https
Myles Braithwaite 👾 via talk
2018-07-30 20:09:40 UTC
Permalink
Post by Alvin Starr via talk
Does anybody know how to display and work with SI numbers like 10k or
20M or 40G within LIbreOffice?
I have had little luck searching with google et al.
While I am at it how about engineering notation?
I think you looking for superscript and/or subscript:
<https://help.libreoffice.org/Writer/Making_Text_Superscript_or_Subscript>
for display.

If you are working in Calc look at:
<https://help.libreoffice.org/Common/Number_Format_Codes#Scientific_Notation>
---
Talk Mailing List
***@gtalug.org
http
Alvin Starr via talk
2018-07-30 20:17:41 UTC
Permalink
Post by Myles Braithwaite 👾 via talk
Post by Alvin Starr via talk
Does anybody know how to display and work with SI numbers like 10k or
20M or 40G within LIbreOffice?
I have had little luck searching with google et al.
While I am at it how about engineering notation?
<https://help.libreoffice.org/Writer/Making_Text_Superscript_or_Subscript>
for display.
<https://help.libreoffice.org/Common/Number_Format_Codes#Scientific_Notation>
Scientific notation is 1.87272837373E+5  and engineering notation tends
to be 3 digits and an exponent that is a multiple of 3 like 103E+3 or
2.25E-6

For SI 1000 =1k 1000000=1M and so on.
SI like output is what you get from df -h or ls -h
--
Alvin Starr || land: (905)513-7688
Netvel Inc. || Cell: (416)806-0133
***@netvel.net ||
Tim Tisdall via talk
2018-07-31 13:13:29 UTC
Permalink
Does anybody know how to display and work with SI numbers like 10k or 20M or
40G within LIbreOffice?
I think you may have to do it manually with a series of nested IF
statements. So, if x>1,000,000,000 then x/1,000,000,000 + "G" else if
...
---
Talk Mailing List
t
Stewart Russell via talk
2018-07-31 16:23:42 UTC
Permalink
Not without macros. LibreOffice is kinda hamstrung by its file format and
MS Excel compatibility. Gnumeric can do this, but it's never had to play to
a big compatibility or business market.

It's supposed to have true engineering notation in LibreOffice Calc > 4.5
or so, not just the three s.f. thing that so many people call engineering
notation.

Stewart
Stewart C. Russell via talk
2018-08-05 21:26:46 UTC
Permalink
Post by Alvin Starr via talk
Does anybody know how to display and work with SI numbers like 10k or
20M or 40G within LIbreOffice?
I had a think about this, and came up with this function for text in
cell D2:

=IF(LEN(T(D2))=0, D2,CONVERT(VALUE(LEFT(D2,
SEARCH(" ",D2))),MID(D2,SEARCH(" ",D2)+1,1)&"m","m"))

This assumes you've used a single space between the value and the unit
prefix, as is SI-correct. Couldn't see an easy way of doing this without
the space, tbh.

The way the above function works:

* if the argument is a numeric value, pass it through

* if the argument is a string, return CONVERT(«numeric part»,
"«prefix»m", "m"). This is sorta misusing the unit conversion function
by going via metres, but it saves having a lookup table or custom function.

Examples:

Input Value
1 u 1E-06
10 u 1E-05
100 u 1E-04
1 m 0.001
10 m 0.01
100 m 0.1
1 1
10 10
100 100
1 k 1000
10 k 10000
100 k 100000
1 M 1000000


Note that this won't work with IEC 60027-2 binary prefixes.
Post by Alvin Starr via talk
While I am at it how about engineering notation?
That now works under the normal Ctrl-1 format menu
---
Talk Mailing List
***@gtalug.org
https://gtalug.org/mailman/listin

Loading...