
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 alvin@netvel.net ||

Alvin Starr via talk wrote on 2018-07-30 3:46 PM:
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>

On 07/30/2018 04:09 PM, Myles Braithwaite 👾 via talk wrote:
Alvin Starr via talk wrote on 2018-07-30 3:46 PM:
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>
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 alvin@netvel.net ||

On 30 July 2018 at 15:46, Alvin Starr via talk <talk@gtalug.org> wrote:
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 ...

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

On 2018-07-30 03:46 PM, Alvin Starr via talk wrote:
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.
While I am at it how about engineering notation?
That now works under the normal Ctrl-1 format menu
participants (5)
-
Alvin Starr
-
Myles Braithwaite 👾
-
Stewart C. Russell
-
Stewart Russell
-
Tim Tisdall