Topic: Results
Online Help
Formatting
Calcpad does not simply calculate formulas. It also builds a professional looking report out of your source code. It uses Html to format the output. It is widely recognized and allows you to publish your calculations on the web. You can select between two different styles for equation formatting: "professional" and "inline". The professional style uses division bar, large and small brackets, radical, etc. Numerator and denominator are displayed one above the other. The inline style uses slash for displaying division and all symbols are arranged into a single line. The following formatting rules are applied:
- Intervals are maintained automatically.
- Variables are formatted as italic.
- Multiplication operator "*" is replaced with "∙".
- Exponentiation operator "^" is formatted as superscript.
- Underscore "_" is formatted as subscript.
- Square root function is replaced with radical "√ ".
Several examples of formatting in different cases are provided in the table below:
Text | Html |
---|---|
x + 3 |
x + 3 |
x-3 |
x – 3 |
3*x |
3∙x |
(x + 1)/3 |
(x + 1)/3 or x + 13 |
x+3 * y |
x + 3∙y |
sqr(x+3) |
√x + 3 |
x_1^3 |
x13 |
sin(x) |
sin(x) |
Html formatting makes the report easier to read and check than the respective plain text. You can also insert additional Html code inside the comments that will affect the final appearance. In this way, you can use Calcpad code to build professional Web applications. You will also need the cloud version of Calcpad for that purpose.
Calcpad uses for decimal separator the symbol defined in the Windows' Regional Settings.
Custom format strings
You can specify format strings for different parts of your worksheet and even for individual output values. At worksheet level you can do that by following command:
#format
format string
To restore the default formatting, add the following line:
#format default
To specify a format string for an individual output value, add a colon followed by the respective string, e.g.:
x = 12.345:
format string
If you have units, the format specifier is positioned after the units:
x = 12.345cm:
format string
There are several types of format strings that you can use:
Code | Description | Examples |
---|---|---|
E n or e n |
Exponential (i.e. engineering or scientific). n - number of decimal digits (0-17) The default value is n = 6 if omitted. When capital E is used, the result is displayed as ×10⁺∕₋000 |
123456.789:e = 1.234568e+0050.00123456:e2 = 1.23e-003123456789:E3 = 1.235×10+008 |
F n or f n |
Fixed-point. n - number of decimal digits (0-17) The default value is n = 2 if omitted. |
123.456789:f = 123.460.00123456:F5 = 0.00123123:F2 = 123.00 |
G n or g n |
General. n - number of significant digits (0-17) The default value is n = 15 if omitted. Displays either fixed point or scientific. |
123.456789:g = 123.4567890.0012345678:g3 = 0.00123123456m:G3 = 1.23×105 m |
N n or n n |
Number (fixed point with digit grouping). n - number of decimal digits (0-17) The default value is n = 2 if omitted. The symbols defined in Windows' Regional Settings are used for thousands and decimal separators. |
123.456789:n = 123.460.0012345678:N3 = 0.001123456:N3 = 123,456.000 |
C n or e n |
Currency (fixed point with currency symbol and digit grouping). n - number of decimal digits (0-17) The default value is n = 2 if omitted. The currency symbol defined in Windows' Regional Settings is used. |
123.456789:C = 123.46 €0.0012345678:C3 = 0.001 €123456:C = 123,456.00 € |
0 # 00# 0.000 #.### 0,000.0## 0.0E+00 0.#e-00 etc. |
Custom. It is composed of the following characters: 0 - zero placeholder. Displays either a digit or zero if a digit is not available. # - optional digit placeholder. Displays a digit if available or nothing. . - decimal separator. , - group separator. E, e, E+, e+, E-, e- - exponential notation. |
123.456789:000000 = 000123123.45:0.0000 = 123.4500123.45:0.#### = 123.450.00123456:#.##### = .001231234567:#,#.0 = 1,234,567.01234567:0.00e+00 = 1.23e+061234567:0.00e-0 = 1.23e60.01234:#.##e-000 = 1.23e-0020.12:0.000e-00 = 1.200e-01 |
Table of contents
-
+
About Calcpad
-
+
Writing code
-
+
Coding aids
-
+
Expressions
-
+
Reporting
-
+
Programming
-
−
Results
-
+
Working with files