Share

acdbRToS

C++

template <size_t nBufLen> inline int acdbRToS(
    double v, 
    int unit, 
    int prec, 
    wchar_t (& buf)[nBufLen]
);

File

acedads.h

Description

Deprecated. Formats a floating-point value as a string.

The following table lists the valid values for the units argument.

Linear units values:

1 Scientific
2 Decimal
3 Engineering (feet and decimal inches)
4 Architectural (feet and fractional inches)
5 Fractional

The current value of the AutoCAD DIMZIN dimensioning variable controls how acdbRToS() writes leading or trailing zeros to str.

If acdbRToS() succeeds, it returns RTNORM; otherwise, it returns an error code.

Parameters

Parameters Description
v Value to format
unit Units into which the string is formatted as a valid AutoCAD LUNITS value; if -1, uses the current value of LUNITS
prec Number of decimal places of precision to include in the string; if -1, uses the current value of the AutoCAD LUPREC system variable
buf Resulting string

Previous Declaration

AutoCAD 2024 and earlier

template <size_t nBufLen> inline int acdbRToS(ads_real v, int unit, int prec, wchar_t (& buf)[nBufLen]);

Use Instead

ACCORE_PORT int acdbRToS(double val, AcString & sOut, int unit = -1, int prec = -1);

History

AutoCAD 2025

v argument changed from ads_real to double.

Was this information helpful?