Custom Units

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

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>.

File "UnitsOwn Units.txt"
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.

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.txtLength (Metre, m)
length.txtArea (Square Metre, m²)
volume.txtVolumen (Cubic Metre, m³)
mass.txtMass (Kilogram, kg)
density.txtDensity (Kilogram per Cubic Metre, kg/m³)
temperature.txtTemperature (Kelvin, K)
time.txtTime (Second, s)
speed.txtSpeed (Metre per Second, m/s)
acceleration.txtAcceleration (Metre per Square Second, m/s²)
flow.txtVolume Flow (Cubic Metre per Second, m³/s)
kitchen.txt Kitchen (Cubic Metres, m³)
information.txtInformation and Storage (Bit)
quantity.txtQuantity (Items)
shoesize.txt Shoe Size (Centimetres, cm)
energy.txtEnergy (Joule, J)
power.txtPower (Watt, W)
force.txtForce (Newton, N)
torque.txtTorque (Newton Metre, Nm)
pressure.txtPressure (Pascal, Pa)
frequency.txtFrequency (Hertz, Hz)
voltage.txtElectromotive Force (Volt, V)
electriccurrent.txtElectric Current (Ampere, A)
electriccharge.txtElectric Charge (Coloumb, C)
electricalresistance.txtElectrical Resistance (Ohm, Ω)
luminousintensity.txtLuminous Intensity (Candela, cd)
luminance.txtLuminance (Candela per Square Metre, cd/m²)
illuminance.txtIlluminance (Lux, lx)
radiationactivity.txtRadiation Activity (Becquerel, Bq)
radiationexposure.txtRadiation Exposure (Röntgen, R)
radiationabsorbeddose.txtRadiation Absorbed Dose (Gray, Gy)
radiationequivalentdose.txtRadiation Equivalent Dose (Sievert, Sv)
planeangle.txtPlane Angle (Radian, rad)
amountofsubstance.txtAmount of Substance (Mol)