# 6.8.19 SET DECIMAL SCALE

Part of: [6 Language](6-language.md) › [6.8 Data Miscellaneous Language (DMISCL)](6-8-data-miscellaneous-language-dmiscl.md)

### Syntax

**SET**  **DECIMAL**  **SCALE** {_decimal_scale_value_ | **DEFAULT**}

### Description

Set the decimal scale[^58] (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)

```hdfql
# 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
```

[^58]: 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.
