Suppressing blanks when converting numbers to characters in Oracle

By default, a converted number to character prefixes a space (‘ ‘). To suppress all trailing and leading spaces, use FM. For example:

LotNum := to_char(intLotNbrBase, 'FM0000000') || to_char(intLotNbrExt, 'FM000')

produces

2080764.001

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: