In addition to the great number of pre-defined units in the Unit Converter, you can also create user-defined arbitrary units, which can be added to existing or completely new categories. All of the custom units will be saved in the directory "Units" in the application folder. For each category, a new file is created. The files can be created with any text editor or you can use the editor of the Unit Converter, which can be found in the menu "Program > User defined Units". Both possibilities will be explained in the next two sections and in the last sections, you get an overview over all formats, you can use in terms and factors and the file names of pre-defined categories.
- Create Unit Lists in the Unit Converter
- Create Unit Lists in any Editor
- Introduction to the Format of Terms and Factors
- File Names for pre-defined Categories
Create Unit Lists in the Unit Converter
The internal editor for unit lists can be found in the menu "Program > User defined Units". With this editor, you can easily create own units, you do not have to care about the saving and it is immediately checked whether the used factors and terms are compatible with the Unit Converter.
First of all, you have to select a category on the top of the window, in which the units should be saved. In the list, all pre-defined categories are available, which can be selected here. If you want to create a new category, you can simply enter a new name in this box (for example "Own Units"). If there are some user-defined units in a selected category, these units will be displayed in the table, in which names, shortcuts, systems, factors and terms of all units are listed. You can sort this table and you can delete and select units to change them.
Under the table, there is a box in which you can create new units. Here you can enter the name, a shortcut (not neccessary), a name for the system and the factor with which the unit is converted. The conversion can either be carried out with an arbitrary factor (for example "12", "2+1/3", "2PI" or "SQRT2") or you can use one term to go from the unit two one and one term to go from one to the unit (for example "1-x" and "1+x" or "x/3+2" and "(x-2)*3"). With these terms, you can also calculate difficult transformation rules. An overview over all possibilities of the terms and factors, you can get in this section. After filling out all boxes, you can click on "Add Unit" to add the new unit to the table and to the current list of units. After that, you can create the next units.
If you add a new unit to an existing list, it is important to notice the right benchmark. The benchmark of all of the categories is listed in the table at the buttom of this page. For example in the list "Length", the benchmark is 1 metre, in the list "Area" it is 1 square metre. If you cerate a new unit which is defined by 2 Units = 1 Metre, you have to use the factor 2, because 1 Metre * 2 = 1 Unit. If you create a new unit which is equal to three square metres, you have to use the factor 1/3, because you have to calculate 1 square metre * 1/3 to get the right value of your unit.
After adding all of your own units to the list, you can click on "Save Category". With this, the category is saved and will be available in the main window.
Create Unit Lists in any Editor
In addition to the usage of the internal editor, lists of units can also be created with any text editor. The format of the resulting text file does not matter, you can save the file as ANSI text as well as in any Unicode format like UTF-8 or UTF-16. It is only important that this file is saved in a folder named "Units" in the directory of the Unit Converter and the file extension have to be .txt. The name of this file is then used as category name. Some file names (see overview at the end of this section) stand for one of the pre-defined categories. For example, the units from the file "Units/length.txt" will automatically be added to the category "Length".
After you have created a file, for example "Own Units.txt" in the folder "Units", you can work on this file with your text editor. Every single line of this file represents one unit and the columns have to be separated with a tabulator. In the first column, there is the name, then the shortcut and then the system of the unit. In the last column, there is a factor or a term for the conversion of the unit. In the following you can see an example of such a file. The tabulators are written as <TAB> and the line breaks with <CR>.
Name 1<TAB>Shortcut 1<TAB>System 1<TAB>1<CR>
Name 2<TAB>Shortcut 2<TAB>System 1<TAB>2<CR>
Name 3<TAB>Shortcut 3<TAB>System 1<TAB>abc<CR>
Name 4<TAB>Shortcut 4<TAB>System 1<TAB>1+1/3<CR>
Name 5<TAB>Shortcut 5<TAB>System 1<TAB>LN7<CR>
Name 6<TAB>Shortcut 6<TAB>System 1<TAB>1E-9<CR>
This is a comment.
Name 7<TAB>Shortcut 7<TAB>System 2<TAB>x-1,5&x+1,5<CR>
Name 8<TAB><TAB>System 2<TAB>x/5-2&(x+2)*5<CR>
Name 9<TAB><TAB>System 2<TAB>x/10&x*10<CR>
Every line stands for one unit. In the file there are the units named "Name 1" to "Name 9". A shortcut is given to the seven units at the top of the file, for the last units no shortcut is defined. The first six units are ordered with the name "System 1" and the other three units with the system "System 2". In the line between "System 1" and "System 2", there is a comment. All of the lines that do not contain three tabulators are threated ad comments, so that you can use arbitrary comments ore line breaks in the files to order your units. Please note, that these comments will be deleted after overwriting the file with the unit editor of the Unit Converter. If you only load files, the comments will not be deleted.
In the last column, there is a factor or term for each unit. "Name 1" has 1 as factor, "Name 2" has the factor 2, so that when working with these units, "Name 2" is alway twice "Name 1". For example, if you enter 4 for the first unit, the value will be 8 in the secound unit. If you enter 1 for the secound unit, the value will be 0,5 for the first unit.
The unit "Name 3" has a incorrect factor, so this unit is ignored and not loaded when using this list. The units 4, 5 and 6 show further possibilities to create factors, a list of all possibilities you can read in the section at the end of this page.
The units of the "System 2" are defined with terms. The first of the two terms separated with the character & tells the Unit Converter how to go from the unit to one and the other term tells the Unit Converter how to go from one to the unit. This means that the secound term is the reverse term of the first term (of course, this is not neccessay, but otherwise, the results are not correct when converting values from or to this unit). The character & is used to separarate the terms and there is also a x as variable in the terms. Excluding the x, in the terms can be used the same expressions like in factors.
The Format of Terms and Factors
In the following table you can see all formats and characters, you can use in the Unit Converter. Unless otherwise stated, you can use all of the characters in factors, numbers and terms when creating new units as well as when entering values to convert them.
- 0-9: You can use the digits 0 to 9 everywhere. You can use a point (1.0) or a comma (1,0) as decimal separator.
- (): You can use brackets to group numbers or factors.
- +-*/: For the four basic arithmetic operations, you can use the characters +, -, * and /.
- ^: To use an exponent, you can use this character like this example 2^2=4.
- PI: The constant PI = 3.141593 can be used like any other value.
- INCH: The constant INCH = 0,0254 shows how many inches are equal to one metre.
- SQINCH: The constant SQINCH = 0.00064516 shows how many square inches are equal to one square metre.
- CUINCH: The constant CUINCH = 0.00001638706 shows how many cubic inches are equal to one cubic metre.
- SQRT: SQRT is the radical, for example SQRT2 = 1,414214.
- FAK: Calculates the factorial of a value, for example FAK3 = 1*2*3*4=24
- SIN, COS, TAN, ARCTAN, ARCSIN, ARCTAN: Radian. You can use these functions like: SIN1 = 0.84147098.
- SIN°, COS°, TAN°, ARCTAN°, ARCSIN°, ARCTAN°: Degree. You can use these functions like: SIN°1 = 0.0174524.
- LN, LG, LB: These logarithmic functions are for your proposal.
- INT: Rounds a value like INT1.2 = 1.
- X: The X can only be used with terms.
File Names for pre-defined Categories
The following file names stand for the pre-defined categories. If you save some file names under one of this names, the units will be shown within this category. For example, if you save some units under the name "length.txt", the units will be added to the pre-defined category "Length". You only have to care about these file names, if you want to create file lists manually, otherwise the internal editor will create the right files. If you use other file names than mentioned in the table, the units from this file will be added to a new custom category with the name of the file.
Each of the categories has one unit (the benchmark) which is defined as 1 (for example second for the category "Time"). The factors of new units have to be choosen so that this calculation is right: 1 New Unit = 1 Benchmark Unit * Factor. So, if one of your unit is equal to two seconds, you have to use the factor 2 in the category "Time".
|File Name||Category and Benchmark|
|area.txt||Length (Metre, m)|
|length.txt||Area (Square Metre, m²)|
|volume.txt||Volumen (Cubic Metre, m³)|
|mass.txt||Mass (Kilogram, kg)|
|density.txt||Density (Kilogram per Cubic Metre, kg/m³)|
|temperature.txt||Temperature (Kelvin, K)|
|time.txt||Time (Second, s)|
|speed.txt||Speed (Metre per Second, m/s)|
|acceleration.txt||Acceleration (Metre per Square Second, m/s²)|
|flow.txt||Volume Flow (Cubic Metre per Second, m³/s)|
|kitchen.txt||Kitchen (Cubic Metres, m³)|
|information.txt||Information and Storage (Bit)|
|shoesize.txt||Shoe Size (Centimetres, cm)|
|energy.txt||Energy (Joule, J)|
|power.txt||Power (Watt, W)|
|force.txt||Force (Newton, N)|
|torque.txt||Torque (Newton Metre, Nm)|
|pressure.txt||Pressure (Pascal, Pa)|
|frequency.txt||Frequency (Hertz, Hz)|
|voltage.txt||Electromotive Force (Volt, V)|
|electriccurrent.txt||Electric Current (Ampere, A)|
|electriccharge.txt||Electric Charge (Coloumb, C)|
|electricalresistance.txt||Electrical Resistance (Ohm, Ω)|
|luminousintensity.txt||Luminous Intensity (Candela, cd)|
|luminance.txt||Luminance (Candela per Square Metre, cd/m²)|
|illuminance.txt||Illuminance (Lux, lx)|
|radiationactivity.txt||Radiation Activity (Becquerel, Bq)|
|radiationexposure.txt||Radiation Exposure (Röntgen, R)|
|radiationabsorbeddose.txt||Radiation Absorbed Dose (Gray, Gy)|
|radiationequivalentdose.txt||Radiation Equivalent Dose (Sievert, Sv)|
|planeangle.txt||Plane Angle (Radian, rad)|
|amountofsubstance.txt||Amount of Substance (Mol)|