Page History: Units
Compare Page Revisions
Page Revision: 2013/05/07 00:51
SMath Studio can handle units; there's a large list of
built-in units available for the most common applications that could be easily extended by the user.
Units are represented with an | italic blue-colored font | . |
![unit example](GetFile.aspx?File=units%2funits_wiki_01.png)
Insert a unit
To insert a unit, press the apostrophe (
') and then digit the unit name; the placeholder shape will change and the dynamic assistance box can help you showing the built-in units (mouse pointer
double-click or press the
TAB key to insert the selected unit in the formula).
![insert unit](GetFile.aspx?File=units%2funits_wiki_02.gif)
Alternatively you can add a built-in unit by the units window (
CTRL+W or menu "
Insert" > "
Unit..."), where you can easily find the unit by name or by family.
![units window](GetFile.aspx?File=units%2funits_wiki_03.png)
Evaluating an expression that contain units, the output will be delivered with the default units (SI base units); to change the output unit, write your favorite unit in the right placeholder.
![output unit](GetFile.aspx?File=units%2funits_wiki_04.gif)
NOTE: the multiplication sign for units is hidden by default, so units like
kN*m are shown
kN m; to avoid errors the right way to type the unit is
'kN*'m,
not 'kNm.
Custom units
You may define/override an unit inside the sheet (simplest way) or handling the
Units.xml file.
![units define](GetFile.aspx?File=units%2funits_wiki_05.png)
Units language
From the menu "
Tools" > "
Options..." you can change the units language.
![units language](GetFile.aspx?File=units%2funits_wiki_06.png)
The unit localization changes the way in which is written the unit of measurement.
![units localization](GetFile.aspx?File=units%2funits_wiki_06_B.png)
Unit description
Both built-in and custom unit description can be retrieved as a string using the
description() function; description's language depends on
Interface language.
![units language](GetFile.aspx?File=units%2funits_wiki_07.png)
Known issues
to inform the developers about issues you found out use the forum: bugs&problems |
Not all built-in functions work with units; to work with these functions divide the argument for the expected unit and multiply the result by the same unit.
![built-in functions](GetFile.aspx?File=units%2funits_wiki_08.png)
The 0 value have no units. If you want an unit as output even when the result can be null, set the unit in the right placeholder.
![null output](GetFile.aspx?File=units%2funits_wiki_09.png)
Be careful in handling relative and absolute temperature units; there's an open discussion
here.
History
- SMath 0.87.3719 (Beta): first relase
- SMath 0.88 (Stable): first stable relase
- SMath 0.90 (Stable): translatable units implemented
See also
References
- Introduction to SMath Studio 0.88 - page 15, PDF
- Video examples of calculations with units for hydraulics (G.Urroz) - See Part 2 SMath Studio
- Crib Sheet for SMath Studio 0.95 - PDF
- Crib Sheet for SMath Studio 0.90 - PDF
- Crib Sheet for SMath Studio 0.89 - PDF
- Crib Sheet for SMath Studio 0.88 - PDF
- Custom units examples - sm
- Unit.xml editing - SMath forum