Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline crun  
#1 Posted : 24 February 2010 15:17:48(UTC)
crun


Rank: Advanced Member

Groups: Registered
Joined: 24/02/2010(UTC)
Posts: 34
Location: a

I would like an option for displaying results in engineering notation/format
ie where the exponents are all multiples of 3. This is a lamented feature of the old HP calculator.
eg scientific format = 3.7*10^4 ; engineering format = 37*10^3

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline crun2  
#2 Posted : 03 March 2014 11:01:42(UTC)
crun2


Rank: Member

Groups: Registered
Joined: 27/02/2010(UTC)
Posts: 10

Further, where units are used, it would be able to display results with the correct exponent prefix
eg where now it shows "1.4*10^-8 m" it would show "14 nm".

Under Tools>Options>Calculation tab, below "Exponential Threshold" entry field add checkboxes for
- Engineering Format Exponents (tooltip says "makes all exponents multiples of 3"Wink
and Use Exponent Prefix for Units (tooltip says "eg Display mm instead of 10^-3 m"
Offline mkraska  
#3 Posted : 03 March 2014 16:15:15(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,987
Germany

Was thanked: 1124 time(s) in 721 post(s)
You can do that right now.

The attached help page is found in the interactive handbook under

Toolbar [?]> Units of Measurement> Units in Results Display
File Attachment(s):
Section operation units.sm (21kb) downloaded 41 time(s).
mkraska attached the following image(s):
unit.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 03/03/2014(UTC)
Offline zapzapouch  
#4 Posted : 13 November 2014 19:23:54(UTC)
zapzapouch


Rank: Member

Groups: Registered
Joined: 03/07/2014(UTC)
Posts: 27
United States

That's just setting the units manually, though. It should be possible to specify the unit as "m", and it automatically displays "10 nm" or "10 km" when the number changes, without manually typing in "km".
Offline brotjob  
#5 Posted : 15 November 2014 13:15:28(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

Was thanked: 7 time(s) in 7 post(s)
Originally Posted by: zapzapouch Go to Quoted Post
It should be possible to specify the unit as "m", and it automatically displays "10 nm" or "10 km" when the number changes, without manually typing in "km".


Can you specify such an algorithm? When would you change? 1.005 km or 1005 m? Would you also use the prefixes hecto deca deci and centi? No? But i.e. centimetre is widely used in construction engineering and hectolitres in the brewing industry. In mechanical engineering we use millimetres even for long measurements up to 50000 mm and short measurements down to one thousandth millimetre.

Would you rather write 1 day instead of 86400 s? Keep in mind day is not a SI unit just as degrees, litres and tonnes. So which prefix should Smath automatically use?

Because I do not see the algorithm I prefer setting my units manually. The only thing I could imagine is a set of tables for specific industries and units. I.e. use tonne for weights above 1000 kg (instead of Megagramms), in mechanical industry always use millimeters for lengths, use hours for time >1000 s and so on.

Edited by user 15 November 2014 13:41:12(UTC)  | Reason: Not specified

Offline zapzapouch  
#6 Posted : 15 November 2014 16:08:36(UTC)
zapzapouch


Rank: Member

Groups: Registered
Joined: 03/07/2014(UTC)
Posts: 27
United States

Originally Posted by: brotjob Go to Quoted Post
1.005 km or 1005 m?


1.005 km

Quote:
Would you also use the prefixes hecto deca deci and centi?


No, only multiples of 1000.

Quote:
In mechanical engineering we use millimetres even for long measurements up to 50000 mm and short measurements down to one thousandth millimetre.


So enter mm in the units box.

Quote:
Would you rather write 1 day instead of 86400 s?


86.4 ks

Quote:
Because I do not see the algorithm I prefer setting my units manually.


You will still be able to set units manually.

Added an issue here, where it sounds like there could be a special unit that means "automatic prefixes": http://smath.info/bts/Is...IssueDetail.aspx?id=1245

Quote:
The only thing I could imagine is a set of tables for specific industries and units. I.e. use tonne for weights above 1000 kg (instead of Megagramms), in mechanical industry always use millimeters for lengths, use hours for time >1000 s and so on.


That could be good, too.
Offline crun2  
#7 Posted : 06 December 2014 10:46:13(UTC)
crun2


Rank: Member

Groups: Registered
Joined: 27/02/2010(UTC)
Posts: 10

Originally Posted by: brotjob Go to Quoted Post
Originally Posted by: zapzapouch Go to Quoted Post
It should be possible to specify the unit as "m", and it automatically displays "10 nm" or "10 km" when the number changes, without manually typing in "km".


Can you specify such an algorithm?


Yes, here are two examples, if Andrei would like a template:

In Javascript
http://www.i2cchip.com/miscstuff/functionLib.js
(function is Real2Eng)

In Pascal:
http://www.i2cchip.com/miscstuff/engfmt.zip
It is inside spstring.pas. The helpfile explains in detail what the function Float2EngStr does:

function Float2EngStr(R:extended;MantissaDigits:word;FormatStr:string; Suffix:string):string

turns a real no. into a Engineering formatted string of PRECISION digits accuracy,
Engineering Format shifts exponent to powers of 3 (familiar to HP calculator users)
Will also suffix appropriate letter multipliers instead of E+XX eg k,M etc

To use defaults try Float2EngStr(1.0123456E4,0,'','' ) -> ' 10.12E+03'

MantissaDigits: number of digits (not including decimal) min is 3; 4 recomended

(default=4)

FormatStr: This set of chars sets how sign and exponents appear.
(default=' E-2' )
Format Str[1] sets how the leading char or sign appears
' ' leading <space> for +ve , - for -ve
'|' no leading char for +ve, - for -ve
'+' always has leading + or -;
'-' no leading char for +ve,reduces precision by 1 for -ve to accomodate -
only if precision>=4; recommended for >=5. Keeps length constant for +ve & -ve #'s
FormatStr[2] sets exponent style and case. if lower case will use lower case 'e'
'E','e' : force exponential form
'F','f' : use prefix chars where possible (ie for E-15 to E+14 )
FormatStr[3] sets how exponent sign appears
'+' : always have + or - (string will be constant length)
'|' : no + for +ve, - for -ve (string will change length)
'-' : use + for +ve unless exponent>digits, then drop + to keep length constant
' ' : <space> is NOT A VALID OPTION. Pascal read routines require EXXX not E XXX
FormatStr[4] number of digits in ExponentDigits (range '1' to '4' )
If exponent has more digits than ExponentDigits (very large or very close to zero)
then length will be greater. See ClipFloat()

If either FormatStr or MantissaDigits are invalid, sets to default.
eg
Float2EngStr(1.978269E+07,5,' F-2','Hz' ) = '19.783 MHz'
Float2EngStr(1.978269E+07,5,' E-2','' ) = '19.783E+06'
Float2EngStr(1.978269E-02,5,'-f-2','' ) = '-19.78e-03'
Float2EngStr(1.978269E+103,5,'-f-2','' ) = '19.783e102'
Float2EngStr(-1.978269E+103,5,'-F-2','' ) = '-19.78E102'

Edited by user 06 December 2014 10:50:52(UTC)  | Reason: Not specified

Offline crun2  
#8 Posted : 06 December 2014 11:10:00(UTC)
crun2


Rank: Member

Groups: Registered
Joined: 27/02/2010(UTC)
Posts: 10

BTW, it would also really help to have a fast way of entering powers of ten.
In electronics, every number has a large exponent and entering 15 * 10 ^ 7 is harder than 15E7
(8 keystrokes vs 4)

I think that there should be an option to treat the special case of <number>E<number> , as the exponent operator.
* is automatically inserted when going from numbers to letters, but this is no problem.
ie new behaviour: 15E6 -> 15*10^6
old: 15E6 -> 15*E6

Problem: variable names like E or E6FilmMass, would need to have an operator explicitly used, and could not use the current automatic * operator insertion

Alternatives: use ctrl+E or alt+E as simple keystroke macro to insert: *10^
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.