in the code.
Some examples:
grpfrc(1.23456789012,3) returns "1.234 567 890 12 E0"
grpfrc(1.23456789012,4) returns "1.2345 6789 012 E0"
grpfrcan() returns "1.414 213 562 37 E0"
when 1.41421356237 is the first item in the history display
My examples show the exponent 'E0' because I had the Exponent mode set to Engineering, but these
routines work for any Exponent mode setting.
The code for grpfrc():
grpfrc(x,g)
func
©grpfrc() - Group fraction digits
©12 May 99/dab
©dburkett@infinet.com
©x: number to format
©g: number of fraction digits in group
local n,dp,el,ex,mn,fn,f1
©Convert argument to string
string(x)→n
©Initialize exponent string
""→ex
©Find decimal point and , if any
instring(n,".")→dp
instring(n,"")→El
©Get exponent or set end of string
if El≠0 then
right(n,dim(n)-El+1)→ex
else
dim(n)+1→El
endif
©Get mantissa & fraction strings
left(n,dp)→mn
mid(n,dp+1,El-dp-1)→fn
©Separate fraction digits with space
""→f1
while dim(fn)>g
f1&left(fn,g)&" "→f1
right(fn,dim(fn)-g)→fn
endwhile
©Build & return final result
mn&f1&fn&" "&ex
Endfunc
9 - 11