prg_string_int64_format()

Abstract

Returns a formatted string representation of a signed 64-bit integer.

Syntax

prg_string_int64_format (num, num_before, buf_size, buf, options)
Argument Type Description
num VosT_Int64 Number to format.
num_before unsigned int Maximum number of characters (counting thousands separators and plus/minus sign) to allow. Must be >= 0.
buf_size unsigned int Size of the area for the formatted string.
buf char * Area to hold the formatted string.
options int Format options (see Options in Details).

Return Type

PrgT_Compcode

PrgC_Compcode_Failure if buf or buf_size is nil, the number cannot be formatted, the number exceeds num_before, or the formatted string is larger than buf_size; PrgC_Compcode_Success otherwise.

prg_string_funcs.h

Details

This function creates a formatted string representation of a signed 64-bit (or 32-bit) integer. The string is formatted according to the specifications given by num_before and options. If num is a symbolic value (such as VOSC_NA_INT64_INFINITY), the symbolic name is returned in buf (“Infinity” in this example). The name string will be padded with spaces (if requested by options) up to the requested string size (num_before).

Options

The options argument must be either PRGC_STRING_FROM_INT_NONE or an OR’ed combination of one or more of the following symbolic constants:

  • PRGC_STRING_FROM_INT_NO_THOUSAND_SEPARATOR—do not include the thousands separator character in the string.
  • PRGC_STRING_FROM_INT_EXCLUDE_MINUS_SIGN—do not include a minus sign for negative numbers.
  • PRGC_STRING_FROM_INT_INCLUDE_PLUS_SIGN—include a plus sign for positive numbers.
  • PRGC_STRING_FROM_INT_PAD_LEAD_SPACES—add leading spaces to make the total number of characters (counting thousands separators and plus/minus sign) equal to num_before.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com