18 lines
786 B
C
18 lines
786 B
C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
#ifndef VCC_DECIMAL_H
|
|
#define VCC_DECIMAL_H
|
|
|
|
#if !defined(_COCO_BASIC_) || defined(_CMOC_MC6839_) || defined(_CMOC_NATIVE_FLOAT_)
|
|
#error vcc_fixed requires the CoCo BASIC floating-point backend
|
|
#endif
|
|
|
|
// Write value with 0 through 3 decimal places. Its magnitude must be below
|
|
// 65536 before rounding. Round the represented value to nearest, with ties
|
|
// away from zero. A rounded zero is unsigned. Link with vcccompat.
|
|
// Return the full character count, excluding the terminator. If capacity is
|
|
// positive, write a terminated prefix. NULL is valid only for zero capacity.
|
|
// Return -1 for a bad argument or range, emptying a writable destination.
|
|
int vcc_fixed(char *dest, unsigned capacity, float value, unsigned char places);
|
|
|
|
#endif
|