User Tools

Site Tools


syntax:types

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
syntax:types [2016/11/21 21:35] dmitrysyntax:types [2019/11/02 07:45] – [Sort order] dmitry
Line 2: Line 2:
  
 Any value in EasyMorph can be either number or text or boolean or error. Unlike databases, one column of a table in EasyMorph can hold values of different types, similarly to Excel. Although, keep in mind that most [[syntax:functions]] expect their arguments to be of certain type. Any value in EasyMorph can be either number or text or boolean or error. Unlike databases, one column of a table in EasyMorph can hold values of different types, similarly to Excel. Although, keep in mind that most [[syntax:functions]] expect their arguments to be of certain type.
 +
 ==== Numbers ==== ==== Numbers ====
 Numbers are either integer or decimal numbers with fixed decimal point. Floating point numbers are not supported. Effective range is (-7.9 x 10<sup>28</sup> to 7.9 x 10<sup>28</sup>) / (10<sup>0 to 28</sup>) which is 28-29 significant digits with or without decimal point between them. Numbers are either integer or decimal numbers with fixed decimal point. Floating point numbers are not supported. Effective range is (-7.9 x 10<sup>28</sup> to 7.9 x 10<sup>28</sup>) / (10<sup>0 to 28</sup>) which is 28-29 significant digits with or without decimal point between them.
Line 15: Line 16:
 <code>-12.4</code> <code>-12.4</code>
  
-To convert text values to numbers see [[syntax:functions:asnumber]] function.+To convert text values to numbers see the [[syntax:functions:asnumber]] function.
  
 +==== Dates ====
 +Notice that there is no dedicated type for dates in EasyMorph. Instead, as in Excel, dates are numbers, but only formatted as dates. Such number date represents a number of days since January 1st, 1900. For instance 42680 corresponds to November 6th, 2016, because there are 42680 days from January 1st, 1900 to that date.
 +
 +Dates in expressions can be specified using date literals. A date literal has format #yyyy-MM-dd. For example:
 +
 +<code>#2016-11-06</code>
 +
 +is the same as 42680 and corresponds to November 6th, 2016. Here is an example of date literals in a condition:
 +
 +<code>[Date] >= #2016-10-01 and [Date] <= #2016-12-31</code>
 +
 +Because dates are numbers, there is no need in using a special function for adding days. To get the next day just add 1. However, there is a special function for adding months — [[syntax:functions:addmonths|addmonth()]].
  
 ==== Text ==== ==== Text ====
Line 25: Line 38:
  
 Note: Ampersand (&) is the text concatenation operator. Note: Ampersand (&) is the text concatenation operator.
-To convert values to text see [[syntax:functions:astext]] function.+To convert a value to text see the [[syntax:functions:astext]] function.
  
 ==== Boolean ==== ==== Boolean ====
Line 32: Line 45:
  
 ==== Error ==== ==== Error ====
-Error is a special value that indicates incorrect calculation. It can only be a result of an expression. You can check if a value is an error using [[syntax:functions:iserror]] function.+Error is a special value that indicates incorrect calculation. It can only be a result of an expression. You can check if a value is an error using the [[syntax:functions:iserror]] function. 
 + 
 +You can also create an error values use the [[syntax:functions:error]] function.
  
 ==== Empty values ==== ==== Empty values ====
-If a table cell has no value - it's so called //empty value//. You can check if a column value is empty using [[syntax:functions:isempty]] function. The length of an empty value is always zero.+If a table cell has no value - it'the so called //empty value//. You can check if a column value is empty using [[syntax:functions:isempty]] function. The length of an empty value is always zero.
  
 Empty values are somewhat similar to nulls in relational databases but not exactly. For instance an empty value always equals to another empty value and equals to empty string. Empty values are somewhat similar to nulls in relational databases but not exactly. For instance an empty value always equals to another empty value and equals to empty string.
Line 44: Line 59:
  
 ==== Sort order ==== ==== Sort order ====
-Since in EasyMorph a column can contain values of different types, sorting is also applicable to mixed columns. In case of mixed types ascending sort order is as follows:+Since in EasyMorph a column can contain values of different types, sorting is also applicable to mixed columns. In case of mixed types the ascending sort order is as follows:
   * Empty cells and errors   * Empty cells and errors
   * Booleans   * Booleans
Line 50: Line 65:
   * Numbers   * Numbers
  
-Which means that empty cells and errors are less than anything else, booleans are less than text and numbers, text is less than numbers, numbers are greater than anything else.+Which means that empty cells and errors are less than anything else, booleans are less than text and numbers, text is less than numbers, numbers are greater than any other data type.
syntax/types.txt · Last modified: 2021/05/12 07:33 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki