Most of the time, the number after calculation in the stored procedure or trigger needs to be written into the record, but the result number of this operation is often an infinite decimal number, so we need to make a rounding in advance, if the amount is usually two decimal places. At the beginning of Firebird2.1, many built-in functions were added. In this way, many tasks that had to be done through udfs can be directly used.
Most of the time, the number after calculation in the stored procedure or trigger needs to be written into the record, but the result number of this operation is often an infinite decimal number, so we need to make a rounding in advance, if the amount is usually two decimal places. At the beginning of Firebird2.1, many built-in functions were added. In this way, many tasks that had to be done through udfs can be directly used.
Most of the time, the number after calculation in the stored procedure or trigger needs to be written into the record, but the result number of this operation is often an infinite decimal number, Hong Kong server, Hong Kong server rent, therefore, we need to make a rounding in advance for the Hong Kong virtual host. If the amount is usually two decimal places.
At the beginning of Firebird2.1, many built-in functions were added. In this way, many tasks that had to be done through udfs can be directly used.
For example, the Trunc () function can be used to perform rounding data conversion.
Such as this Code:
FAmount = TRUNC (fAmount * fdiscount * fNumber/fTotal), 2)