DISC

Contents | What's New | Quick Links

 

SQL Functions

Introduction

Software Installation

Concepts and Design

Designing Applications

Omnidex Environments

SQL Reference

Omnidex API's

Utilities

Interfaces

Performance Guide

Troubleshooting Guide

Appendix

 

 

$TRUNC

 

The $TRUNC function returns a numeric expression truncated to a specified number of digits to the right of the decimal point.

If the value specified by n is positive and longer than the digits after the decimal point, 0 is added after the fraction digits.

If the value specified by n is negative and larger than or equal to the digits before the decimal point, 0 is returned.

When a numeric expression is truncated, the trailing digits are simply dropped off. The return value is not rounded in any way.

Syntax

Example

SQL Reference

Commands

Functions

 

Syntax

$TRUNC(expression [,n])

$TRUNC()

Required.

expression

Required. The numerical expression that is to be truncated.

n

Optional. n is an integer indicating the number of digits to display after the decimal point.

top

 

Example

$TRUNC(123.4545, 2) result: 123.45

$TRUNC(123.4545, -2) result: 100

$TRUNC(123.9994, 3) result: 123.999

$TRUNC(123.9995, 3) result: 123.999

 

 

top

Dynamic Information Systems Corporation - Omnidex Version 3.8 Build 6 J15.03-Copyright © 2003

DISC | Documentation Home