Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

decimal data type

Former Member
0 Kudos

Hi,

I know this is a very silly thing to ask.

But i got a doubt regarding the data types.

look at this:

<b>tables: zap.</b> " this is a custom table

in this custom table "zap" the field "price" is defined like this:

<b>field</b>| <b>field type</b>| <b>data type</b>| <b>length</b>| <b>dec. point</b>|

-


price| zap_price| dec | 11 | 6

now in the program there is a field declared like this:

<b>data: zap like zap-price.</b>

now my doubt is:

for the field <b>zap-price</b> is the value can be like this?

a) 46578.654876

or

b) 4687.645478

which one is correct.

Please let me know.

thnx for the help.,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI Lope,

Both the values are valid. It can accept both the values.

The problem arises when the no of digits in decimal place exceeds 6. That too they wil be rounded off. you can try it writing a simple program.

Regards,

Varun.

4 REPLIES 4

Former Member
0 Kudos

HI Lope,

Both the values are valid. It can accept both the values.

The problem arises when the no of digits in decimal place exceeds 6. That too they wil be rounded off. you can try it writing a simple program.

Regards,

Varun.

Former Member
0 Kudos

Total length should be 12 characters - one character for decimal point, 6 places after decimal point and 5 before decimal point.

So both options indicate correct value.

Message was edited by: Ashish Gundawar

Former Member
0 Kudos

Hi,

You a) point is right & so is point b).

Your definition means..

the total length of the field is 11,out of which a max of 6 places for decimals & ofcourse 1 will be assigned to the sign(- or +).

Message was edited by: Phani Kiran Nudurupati

0 Kudos

thnx everybody