Skip Headers

Oracle Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96584-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCI Cartridge Functions, 42 of 43


Format Codes

A format code specifies how to format an argument that is being written to a string.

Note that these codes can appear in upper case, which will cause all alphabetic characters in the output to appear in upper case except for text strings, which are not converted.

Codes Operation

'c'

single-byte character in the compiler character set

'd'

signed decimal integer

'e'

exponential (scientific) notation of the form [-]<d><r>[<d>...]e+[<d>]<d><d> where <r> is the radix character for the current language and <d> is any single digit; the default precision is given by the constant OCIFormatDP. the precision may be optionally specified as a format modifier - using a precision of 0 suppresses the radix character; the exponent is always printed in at least 2 digits, and can take up to 3 for example, 1e+01, 1e+10, and 1e+100

'f'

fixed decimal notation of the form [-]<d>[<d>...]<r>[<d>...] where <r> is the appropriate radix character for the current language and <d> is any single digit; the precision may be optionally specified as a format modifier- using a precision of 0 suppresses the radix character. the default precision is given by the constant OCIFormatDP

'g'

variable floating-point notation; chooses 'e' or 'f', selecting 'f'' if the number will fit in the specified precision (default precision if unspecified), and choosing 'e' only if exponential format will allow more significant digits to be printed; does not print a radix character if number has no fractional part

'i'

identical to 'd'

'o'

unsigned octal integer

'p'

platform specific pointer printout

's'

prints an argument using the default format code for its type:

ociformatub<n>, ociformatuword, ociformatubig_ora, ociformateb<n>, and ociformateword.

the format code used is 'u'.

ociformatsb<n>, ociformatsword, and ociformatsbig_ora.

the format code used is 'd'.

ociformatchar

the format code used is 'c'.

ociformattext

prints text until trailing null is found.

ociformatdouble

the format code used is 'g'.

ociformatdvoid

the format code used is 'p'.

' %' - print a '%'.

'u'

unsigned decimal integer

'x'

unsigned hexadecimal integer


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback