Difference between revisions of "Manuals/calci/UNITSFAILTONULL"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div style="font-size:30px">'''UNITSFAILTONULL'''</div><br/> ==Description== *This function will return the result as false. *If <math>UNITSFAILTONULL</math> is set to true,...")
 
 
Line 2: Line 2:
  
 
==Description==
 
==Description==
*This function will return the result as false.
+
*UNITSFAILTONULL will return the result as false.
 
*If <math>UNITSFAILTONULL</math> is set to true, and a number does not have units that match during conversion, it is set to null.  
 
*If <math>UNITSFAILTONULL</math> is set to true, and a number does not have units that match during conversion, it is set to null.  
*<math>UNITSFAILTONULL</math>  by default is set to false.  
+
*<math>UNITSFAILTONULL</math>  by default is set to false.
 +
*In general, if a conversion fails, the original value with units are returned.
 +
*This behavior can be changed so that a unit conversion if not possible, would return a null value.
 +
*To do this, change the global variable UNITSFAILTONULL to true.
 +
 
 +
*The following will give 1m as the result.
 +
1m<>eor
 +
 
 +
1 m
 +
 
 +
UNITSFAILTONULL=true
 +
 
 +
1m<>eor
 +
 
 +
will now give null as the result.
 +
 
 +
UNITSFAILTONULL=false
 +
 
 +
1m<>eor
 +
 
 +
1 m
 +
 
 +
will be shown as the result.
  
 
==Example==
 
==Example==

Latest revision as of 05:54, 31 March 2020

UNITSFAILTONULL


Description

  • UNITSFAILTONULL will return the result as false.
  • If is set to true, and a number does not have units that match during conversion, it is set to null.
  • by default is set to false.
  • In general, if a conversion fails, the original value with units are returned.
  • This behavior can be changed so that a unit conversion if not possible, would return a null value.
  • To do this, change the global variable UNITSFAILTONULL to true.
  • The following will give 1m as the result.

1m<>eor

1 m

UNITSFAILTONULL=true

1m<>eor

will now give null as the result.

UNITSFAILTONULL=false

1m<>eor

1 m

will be shown as the result.

Example

  1. UNITSFAILTONULL = false

See Also

References