Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the precision and scale part of a decimal

Status
Not open for further replies.

gregitg

Technical User
Oct 7, 2001
3
AT
Hi to everybody,

has somebody an idea how get the precision and scale part of a decimal/numeric datatype?

What I found out is: Both are encoded in the column atttypmod in the table pg_attribute. The column contains a value e.g. 983046 what stands for a decimal(15,2) (this I know accidantly).

Knows sombody the algorithm how to extract the precision and scale from such a value?

Many thanks in advance

Hans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top