Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Datawindow Decimal Field

308 views
Skip to first unread message

Nick N.

unread,
Aug 18, 2004, 4:41:03 PM8/18/04
to
PB9.0.1 + ASE 12.5.

Database column = decimal(18,4)

I know that PB can only handle 18 digit decimals...so it can handle
decimal(18,4).

I create a DW...
Without using an EDIT MASK, is there a way to control user input so it
doesn't overflow?

Meaning...as it is right now a user can input

999999999999999999999999999

then tab out of the column...it will change that number to some other
number, probably because it's overflowing and maybe trying to "round" to
something?

Of course if I use the edit mask

##,###,###,###,###.0000
or
##############.0000

This can be controlled.

So I am asking without using edit masks, is there any way to control this
from happening in the DW itself?


Thanks!!!


Jerry Siegel

unread,
Aug 18, 2004, 4:51:22 PM8/18/04
to
Limit?

"Nick N." <nick.ni...@natexisblr.us> wrote in message
news:4123bedf@forums-1-dub...

Nick N.

unread,
Aug 18, 2004, 5:45:21 PM8/18/04
to
how would you control where the decimal point goes?

For instance, you can enter up to 14 9's and still be ok but on the 15th
it'll round up...

999999999999999 would become 100000000000000

Since powerbuilder can only handle 18 digits for decimal, you can say put a
limit of 18, but that's not restrictive enough since you can overflow the
number at the 15th digit.

Obviously putting a limit of 14 isn't desireable either in this particular
situation.

That doesn't stop someone from inputting 18 9's...
999999999999999999

Which would definitely give you very strange results.

But what if you have a computed column which will take that number and
multipy by quantity...

say

base = 99999999999999.9999 (this is decimal(18, 4))
price = 9999999999.99999999 (decimal(18,10)

base x price = ?????

Definitely will overflow 18 digits and give you stragne results...or the
computed field will turn 0.0...

How does one manage this???


"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message
news:4123c14a$1@forums-1-dub...

JMR

unread,
Aug 19, 2004, 8:55:11 AM8/19/04
to
Validation rule?

Nick N.

unread,
Aug 19, 2004, 1:15:00 PM8/19/04
to
yeah I figured...just wondering how everyone manages this...

thanks

<JMR> wrote in message news:4124a32f.4bb...@sybase.com...

Jerry Siegel

unread,
Aug 19, 2004, 1:42:28 PM8/19/04
to
;-) with edit masks

"Nick N." <nick.ni...@natexisblr.us> wrote in message

news:4124e16e$1@forums-2-dub...

Nick N.

unread,
Aug 19, 2004, 4:22:17 PM8/19/04
to
OK what about this situation though.

Fields:

qty decimal(18,4)
price decimal(18,10)
net_amt decimal(18,2)

These fields themselves are fine since it keeps with PB's definition of
decimal.

But what if there net_amt can also be a computed field via code in the
itemchanged event?
So if qty > 0 and user enters a valid price the net_amt will be calculated
and populated.

say you have these:

qty = 99999999999999.9999 ->this is decimal(18,4)
price = 99999999.9999999999 -> this is decimal(18,10)

In this case qty x price would definitely overflow PB decimal type.

How would I validate this?

It just doesn't work...I mean it's highly unlikely that this would happen
but I'm asked to look into it regardless...


"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message

news:4124e7dc$1@forums-2-dub...

0 new messages