HDFql Reference Manual v2.6.0

6.8.19SET DECIMAL SCALE

Syntax

SET DECIMAL SCALE {decimal_scale_value | DEFAULT}

Description

Set the decimal scale58 (i.e. number of decimal places) to use when writing fractional numbers into a text or Excel file. In case the keyword DEFAULT is specified, the decimal scale is set to five.

Parameter(s)

decimal_scale_value – optional integer that specifies the decimal scale (i.e. number of decimal places) to use when writing fractional numbers into a text or Excel file. If decimal_scale_value is specified, it must be equal to or greater than zero (otherwise an error is raised).

Return

Nothing

Example(s)

# create an HDF5 dataset named "my_dataset" of data type float of one dimension (size 3) with initial values of 3.25, 5.3, and 9.589
CREATE DATASET my_dataset AS FLOAT(3) VALUES(3.25, 5.3, 9.589)

# set decimal scale (to use when writing fractional numbers into a text of Excel file) to 2 
SET DECIMAL SCALE 2

# select (i.e. read) data from dataset "my_dataset" and write it into a text file named "my_file0.txt" using default separator "," (should return "3.25,5.30,9.59" in one single line)
SELECT FROM my_dataset INTO FILE my_file0.txt

# set decimal scale (to use when writing fractional numbers into a text or Excel file) to the default value (i.e. 5)
SET DECIMAL SCALE DEFAULT

# select (i.e. read) data from dataset "my_dataset" and write it into a text file named "my_file1.txt" using default separator "," (should return "3.25000,5.30000,9.58900" in one single line)
SELECT FROM my_dataset INTO FILE my_file1.txt

Notes

  1. By default (i.e. upon initialization of the HDFql library), the decimal scale (i.e. number of decimal places) to use when writing fractional numbers into a text or Excel file is set to five. ↩