Formatting columns in a datawindow (problems with decimal numbers)

Hello,

I have a problem with a datawindow. For a value "qty", the select statement 
for the datawindow is
Select qty = 0.00 from ....

In the datawindow, the field qty is formatted with the format #.## or 0.00

When I enter values in this field, it is rounded, either upwards or 
downwards. So that 3,3 is 3,0 and 3,6 is 4,0

How can I make the datawindow NOT round the numbers I put in?

Alf 


0
Alf
6/21/2006 7:33:35 AM
sybase.powerbuilder.database 9855 articles. 1 followers. Follow

2 Replies
670 Views

Similar Articles

[PageSpeed] 34

Hi Alf,

if the initial value is'nt a problem for
you simply try

    Select qty = 0.99 from ....

to indicate that quantity has two decimal
places. Otherwise indicate the fact using
a convert function according to your
database. Assuming this is ASA that would
be coded as

    Select convert(numeric(10, 2), 0) as qty from ....

HTH

Chris Werner



"Alf Kato Brandal" <alf@abrandal.com> schrieb im Newsbeitrag 
news:4498f64f$1@forums-1-dub...
> Hello,
>
> I have a problem with a datawindow. For a value "qty", the select 
> statement for the datawindow is
> Select qty = 0.00 from ....
>
> In the datawindow, the field qty is formatted with the format #.## or 0.00
>
> When I enter values in this field, it is rounded, either upwards or 
> downwards. So that 3,3 is 3,0 and 3,6 is 4,0
>
> How can I make the datawindow NOT round the numbers I put in?
>
> Alf
> 


0
Chris
6/21/2006 8:31:54 AM
This solved it, I used the convert( ) since the initial always has to be 0.

Thanks a lot. Sorry for the double posting. I'll try to improve my 
newsgroups usage.

Alf

"Chris Werner" <cw{please_no_spam}ATf-s.de> skrev i melding 
news:449903fa$1@forums-1-dub...
> Hi Alf,
>
> if the initial value is'nt a problem for
> you simply try
>
>    Select qty = 0.99 from ....
>
> to indicate that quantity has two decimal
> places. Otherwise indicate the fact using
> a convert function according to your
> database. Assuming this is ASA that would
> be coded as
>
>    Select convert(numeric(10, 2), 0) as qty from ....
>
> HTH
>
> Chris Werner
>
>
>
> "Alf Kato Brandal" <alf@abrandal.com> schrieb im Newsbeitrag 
> news:4498f64f$1@forums-1-dub...
>> Hello,
>>
>> I have a problem with a datawindow. For a value "qty", the select 
>> statement for the datawindow is
>> Select qty = 0.00 from ....
>>
>> In the datawindow, the field qty is formatted with the format #.## or 
>> 0.00
>>
>> When I enter values in this field, it is rounded, either upwards or 
>> downwards. So that 3,3 is 3,0 and 3,6 is 4,0
>>
>> How can I make the datawindow NOT round the numbers I put in?
>>
>> Alf
>>
>
> 


0
Alf
6/21/2006 9:34:54 AM
Reply:

Similar Artilces:

Formatting columns in a datawindow (Problems with rounding of numbers)
Hello, I have a problem with a datawindow. For a value "qty", the select statement for the datawindow is Select qty = 0.00 from .... In the datawindow, the field qty is formatted with the format #.## or 0.00 When I enter values in this field, it is rounded, either upwards or downwards. So that 3,3 is 3,0 and 3,6 is 4,0 How can I make the datawindow NOT round the numbers I put in? Alf Hi Alf, you have an answer to this question in the database NG. Please refrain from cross posting the same question in multiple sybase.public NGs. Kind regards Chris...

External datawindow with columns of type DECIMAL, number of decimals is not saved!!
Almost a year ago, I've posted this problem. It does not seem to be fix yet. When you create an external datawindow and you create a column of type decimal, you can fill in the number of decimals. That number is not saved. When I reopen the datawindow; the number of decimals is 0. The only workaround I've found is to go change it in the source code of the datawindow Greetings Note that posting a problem in one of the newsgroups will not fix it. Only if you open a case with Sybase it will be fixed. On 9 Nov 2004 01:39:15 -0800, in sybase.public.pocketpo...

PROBLEM with Computed Column and Decimal Numbers
I am running PB 6.5, build 444. I have a datawindow with a computed column that sums 4 decimal number columns in the dw and compares them to another decimal column in the dw using the "if" statement. If they are equal, nothing ('') shows, if they are not equal, an X shows in the computed column: The expression is something like: if(dec1 = dec2 + dec3 + dec4 + dec5, '', 'X'). This ALWAYS works fine in development, but after building an executable, it VERY intermitantly does not work. Every once in a while, the 'X' shows even when the condi...

Issue with the display format of a decimal column in Datawindow
This is a multi-part message in MIME format. ---=_forums-1-dub4ad5aed9 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Hi, I have the following issue with the display of a decimal column in a datawindow with Appeon 6.2 for .NET. I don't have whith my application launched in PB 11.5 In my datawindow the column is defined as a decimal(3) with a format format "#######0.000" and an edit format "#######0.000". In my SQL Server 2005 Database the column value for a line is 24.5 After the retrieve my datawindow w...

Format Number to two decimal places problem
Although it should be pretty straight forward, I am having a problem dividing two numbers in two textboxes and displaying the result, formatted to two decimal places, in a third textbox - Box3 This is what I used but the end result still has many decimal places. Box3.Text = String.Format("{0:c}", (Convert.ToDecimal(Box1.Text) / Convert.ToDecimal(Box2.Text))) Hi there, you can do this: Box3.Text = String.Format("{0:c2}", (Convert.ToDecimal(Box1.Text) / Convert.ToDecimal(Box2.Text))) At least in C#, but the number after the C means the number of decimal...

OLE database Blob Column in Datawindow (Word 2000) problem
I created a Dw with a OLE blob column Word 2000 Class. Everything seems to work ok when I Double click on it word open and I am able to save it to the DB and Retreive it. The probleme I have is as follow What I want to do is when a new letter is to be created is force the user from picking a template (Word template document save as image data type in Sql Server) from a list and the body of the letter is populated from this template. How can I copy this Blob from the DB into this blank word window? Is There a ole.data property or something like it in the word object? Can I c...

Powerbuilder Nested datawindow Page Number & Overlap problem
Powerbuilder version 6.0.00 Oracle 8 If one of the nested datawindow is carried over to next page, the page number is supposed to be incremented. But it comes up with previous page number. The page number shown on the report is page 1, 2, 2, 4. Is there any way I can get around in version 6.0.00. I tried this in PB version 6.5. It works correctly. If I migrate my project to version 6.5, is there any known migration problem?? (The reason is I tried to migrate a project from PB 4.0 to PB 5.0.4. The match function is not working the same as PB 4 or PB 6. I got a GPF error wh...

problem with number/number=number ?
hi i need for below 1/36 = 0,0277777777777778 but result should be 1 3/36 should be 1 35/36 should be 1..... (between 1 and 36)/36 should be 1 36/36  and 37/36 and 45/36 and 71/36 should be 2  (between 72 and 37)/36 should be 2  (between 107 and 73)/36 should be 3  and go on how can i do it ? ThanksMark as me if my question or my answer can be helpful for you :) Hi, I think that (int)(n / 36) + 1 will do the trick  hi it work true without below  result 1 for 1/36 and 4 /36 and 35 /36 .. it is true.. but result 2 for 36/36 . res...

How to format a percent number as decimal using string.format in VB?
Hi, I have a GridView-Control with labels which contain numbers in percentformat, which are formatted in the RowDataBound-Event, but when I try to update the GridView i get the Invalid String format Exception because the labels are in the percentage Format like -27,5% but i need this number as double-value like 0.275. How can I convert the number from percentage to number? Any idea?  Thanks in forward,  Vlad  Dim str as string = percentlabel.Text ' Get rid of percentage sign str = str.Replace("%", "") ' Check if you can convert dim dbl as ...

Column Format Problem
hi all we are facing a problem while setting the format for the column we are giving the format as ##,##,###.00 so if the value in that column is say 1234567 the as per format it should show 12,34,567, but it is still giving as 1,234,567. is this a bug in PB or we are doing something wrong we are using PB5. we have also tried the same in PB6,PB6.5 AND PB7 but still the problem exsists. Thanks in advance PB6.0 and PB6.5 works fine and I think also PB5. Peraphs have you set the format only in the EDIT tab and not int the FORMAT tab? However there's a problem using th...

Datawindow column formate
Hi I have a numeric column in a datawindow and its format is 0.0000, initially when the columns are retrieved the display format is fine like 0.7900, but when I click on the column it display like 0.79 and it retains same like 0.79 even after the column focus is loosed. Is there any work around for this. TIA Mahesh.V Use an edit mask rather than a format. A format only applies when the column doesn't have focus. An edit mask applies all the time, including when the user is entering data. On 25 Jun 2005 08:11:14 -0700, "Mahesh.V" <mahesh@ewaksoft.com&g...

Column Format Problem
hi all we are facing a problem while setting the format for the column we are giving the format as ##,##,###.00 so if the value in that column is say 1234567 the as per format it should show 12,34,567, but it is still giving as 1,234,567. is this a bug in PB or we are doing something wrong we are using PB5. we have also tried the same in PB6,PB6.5 AND PB7 but still the problem exsists. Thanks in advance ...

format-problem in datawindow
This is a multi-part message in MIME format. ---=_forums-1-dub4c28b058 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Hi, format problem in powerbuilder 11.5.1 Build 4740. Does anyone have this problem? (in this example: german settings) regards Martin ---=_forums-1-dub4c28b058 Content-Type: image/pjpeg; name="test.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.jpg" /9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgIC AgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKB...

Problems with number formats.
Hi, Im developing an app with PowerBuilder 9 and Oracle 10G. I have a problems when app shows number fields with format property like : #,##0.00 . The problem is that , for example when the number is 30 it should show in this way: 30.00 but it doesnt do it, it shows 0,030.00. But this bug only happens whe the machine runs in a OS different than Windows XP. Anyone knws any solution?,, is a problem of PB? or is a problem of Windows? Thanks in advance I have not ran across this. Have you tried using a computed field? ex: String(amtfield, '#,##0.00') Do you still get th...

Web resources about - Formatting columns in a datawindow (problems with decimal numbers) - sybase.powerbuilder.database

Wikipedia:Manual of Style/Text formatting - Wikipedia, the free encyclopedia
The most common use of boldface is to highlight the article title, and often synonyms, in the lead section (first paragraph). This is done for ...

Formatting « Above the Law: A Legal Web Site – News, Commentary, and Opinions on Law Firms, Lawyers ...
Above the Law: A Legal Web Site – News, Commentary, and Opinions on Law Firms, Lawyers, Law School, Law Suits, Judges and Courts

Android Studio 1.2 Reaches Beta, Adds Built-In Decompiler, Inline Debugger Variables, Smarter Formatting ...
When Android Studio v1.1 entered the Stable channel, about 6 weeks ago, the Dev Tools team gave word that v1.2 was already well underway and ...

TextExpander 2.0 Brings Rich Text Formatting, Fill-In Snippets And More
TextExpander has finally received its big 2.0 update.

WordEver HD - Text Editor with Redesigned Keyboard and MarkDown syntax & formatting highlight
Holen Sie sich „WordEver HD - Text Editor with Redesigned Keyboard and MarkDown syntax & formatting highlight“ im App Store. Sehen Sie sich Screenshots, ...

Macs are vulnerable to Thunderstrike 2 firmware malware that survives formatting
... Thursday, researchers will demonstrate that not only can Macs be remotely infected with malware, but that this malware can survive a user formatting ...

16 Tips on Blog Writing and Formatting
... again. My point is that you ought to take advice with a grain of salt. And that applies to this post as well. Writing blog posts and formatting ...

Select Text With Similar Formatting in Google Docs
Google Docs added a cool new feature that lets you select all the text with similar formatting, so you can quickly make some changes. It's like ...



Resources last updated: 11/22/2015 8:14:40 PM