Difference between revisions of "SET DECIMALS"

From Recital Documentation Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=SET DECIMALS=
 
 
 
==Class==
 
Numeric Data
 
 
 
 
==Purpose==
 
==Purpose==
 
Specify the number of decimal places to be used when displaying the results of numeric expressions
 
Specify the number of decimal places to be used when displaying the results of numeric expressions
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[SET FIXED]], [[ROUND()]]
+
[[ROUND()]], [[SET FIXED]]
  
  
Line 25: Line 18:
  
 
==Example==
 
==Example==
<pre>
+
<code lang="recital">
 
? 285.129 * 4.6
 
? 285.129 * 4.6
1311.5934
+
1311.5934
 
set decimals to 3
 
set decimals to 3
 
set fixed on
 
set fixed on
 
? 285.129 * 4.6
 
? 285.129 * 4.6
 
+
  1311.593</code>
1311.593</pre>
+
  
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 
[[Category:Set_Commands|DECIMALS]]
 
[[Category:Set_Commands|DECIMALS]]
 +
[[Category:Numeric Data]]
 +
[[Category:Numeric Data Set Commands]]

Latest revision as of 15:36, 23 November 2009

Purpose

Specify the number of decimal places to be used when displaying the results of numeric expressions


Syntax

SET DECIMALS TO <expN>


See Also

ROUND(), SET FIXED


Description

The SET DECIMALS command determines the minimum number of decimal places displayed in the result of numeric functions and calculations. For calculations that do not involve numeric functions, division, or multiplication, the number of decimal places displayed is the same as the number or variable with the most decimal places. For calculations involving multiplication, the number of decimal places displayed is the sum of the decimal places of the numbers being multiplied.

The SET DECIMALS command is normally used in conjunction with the SET FIXED command to specify a fixed number of decimal places for calculation results.


Example

? 285.129 * 4.6
 1311.5934
set decimals to 3
set fixed on
? 285.129 * 4.6
  1311.593


Products

Recital Server, Recital