Supress Decimal Point in format

PowerBuilder 8.0.4 Build 10501

How can i get the following

12.43
       1
    1.5
     13

i.e only show decimal places and the dp, if the item is not an integer.

if i use the format #,##0.## i get  :

12.43
      1.
    1.5
    13.

Which is close, but still shows the "." for integers.

I did manages to get it working using a formula within a dw format field 
if(abs(x) <> x,"#,##0.00","#,##0") - but this really slowed down the report 
+ i would also like to use the format in the script string  function  : 
string(12.5,'#,##0.##)

Cheers

Steve. 


0
Steve
4/6/2005 12:24:04 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

2 Replies
1530 Views

Similar Articles

[PageSpeed] 30

if your trying to do this in a datawindow.
try adding the following in the format expression field on
the format  tab of the columns property page.

if(  mod( INT(value_amount) , value_amount ) = 0, '##0' ,
'##0.##' )




> PowerBuilder 8.0.4 Build 10501
>
> How can i get the following
>
> 12.43
>        1
>     1.5
>      13
>
> i.e only show decimal places and the dp, if the item is
> not an integer.
>
> if i use the format #,##0.## i get  :
>
> 12.43
>       1.
>     1.5
>     13.
>
> Which is close, but still shows the "." for integers.
>
> I did manages to get it working using a formula within a
> dw format field  if(abs(x) <> x,"#,##0.00","#,##0") - but
> this really slowed down the report  + i would also like to
> use the format in the script string  function  :
> string(12.5,'#,##0.##)
>
> Cheers
>
> Steve.
>
>
0
tdr
4/6/2005 1:38:40 PM
The expression below have a bug .
If value is < 1 ( 0.123) it's  dispaly 0
The expression must be

if (value_amount < 1, '##0.##',
if(  mod( INT(value_amount) , value_amount ) = 0,
'##0' , '##0.##' )
)




<tdr> wrote in message news:4253e660.6845.1681692777@sybase.com...
> if your trying to do this in a datawindow.
> try adding the following in the format expression field on
> the format  tab of the columns property page.
>
> if(  mod( INT(value_amount) , value_amount ) = 0, '##0' ,
> '##0.##' )
>
>
>
>
>> PowerBuilder 8.0.4 Build 10501
>>
>> How can i get the following
>>
>> 12.43
>>        1
>>     1.5
>>      13
>>
>> i.e only show decimal places and the dp, if the item is
>> not an integer.
>>
>> if i use the format #,##0.## i get  :
>>
>> 12.43
>>       1.
>>     1.5
>>     13.
>>
>> Which is close, but still shows the "." for integers.
>>
>> I did manages to get it working using a formula within a
>> dw format field  if(abs(x) <> x,"#,##0.00","#,##0") - but
>> this really slowed down the report  + i would also like to
>> use the format in the script string  function  :
>> string(12.5,'#,##0.##)
>>
>> Cheers
>>
>> Steve.
>>
>> 


0
Ico
4/18/2005 9:15:49 AM
Reply:

Similar Artilces:

Need to format float with no decimals or decimal point.
Is there a format for float that displays only the integer portion?  Or at the least, integer portion and decimal point but no digits to right? Eval("L_DistCalc", "{0:f}") Thank you, What about this: Eval("L_DistCalc", "{0:f0}")Limno Wow - thanks.  Is there a good reference book that has all the format forms, control structures and properties.  Everything I have has a the essentials but nothing in depth.  I know this kind of thing is simple but is sure is a lot to try and remember. Thank you,  You can sear...

Decimal points in datawindows
I am having a problem with decimals in my datawindows. When I try entering a percentage value, it is abandoning all values to the right of the decimal. Incidentally, the field is a decimal with no validation. Edit Mask: Format: Input: Result: None (General) 3.2 3 None (General) 0.032 0 None (General) 3.2% "Does not pass validation" None 0.00% 3.2 300.00% None ...

How to validate a decimal value with 2 digits after decimal point (de decimal point is a comma)
  I am a newbee, I have a Textbox where de user must write the price of an object. How can I validate de data entry in the Textbox (it must be a valid decimal with 2 digits after decimal point), and my pages are in  Portuguese so the decimal point to be accepted must be a comma   thanks  well you can do something like followig:  suppose TextBox1.Text = 123456,789 then you can say if(TextBox1.Text.Contains(",") ) {     int index1 = TextBox1.Text.IndexOf(",") +1;     int index2 = TextBox1.Text.IndexOf(...

How to format a string of percentage format to decimal format ?
How to format a string of percentage format to decimal format ? 1    orginalValue  // value will be 1265.48 2    percentString // value after applying percentage format will be 126548 %3    requiredvalue // value should be 1265.48  I converted the string from orginalValue to percentString, now i need to convert back to requiredvalue. Is there any way to do ? regards, Ananth RM - msarm.com  string percentString="126548 %";double value=double.Parse(percentString.Replace("%","").Tri...

Problem with decimal point in datawindow
It is version 8.0.1 Build 8004. thanks Glenn ...

Edit format; decimal points
In our PB application we do have a lot of datawindows with quantity fields. Most of the times (99%) the users have to enter whole numbers only but sometimes they want to enter decimal values. In the database I have a decimal field 8.2. but I am struggeling to get a right Edit mask. I like to have the following: Value of the field Display 2.00 2 2.10 2.10 (or 2.1) 2.25 2.25 Empty Nothing The problem is that when I use the format ##,###.## the decimal...

Formatting number with and without decimal point
This is more of a generic powerbuilder question, but can anyone describe how to format a number so that it will show decimal places when there are some but then show the number as an integer (no decimal point) when there are none. Ex. when rounded to 2 decimal places 2.75 should show as 2.75 2.50 should show as 2.5 2.00 should show as 2 Thanks Jay ...

Problem with decimal point in datawindow #2
I have a problem with decimals in a datawindow. -When i use a decimal with editmask #0.00 or #0,00 the number i receive from the datawindow is not a decimal For ex.: dec (datawindow.Object.decimal[1]) = 165 (and not 16.5) I tried to change the settings in the registry in the beginning of my program, because the standard on my computer the decimal sign is a comma. So I change it in the program to a point and at the end of the program back to a comma . I also tried to use an edit field but then i have the same problem. What can i do about this? Thanks Glenn Whic...

Windows 2000 Powerbuilder Decimal Point
The datawindow is an external datawindow. It is not linked to a database. Grtz Glenn ...

Formatting number with and without decimal point
Can anyone describe how to format a number so that it will show decimal places when there are some but then show the number as an integer (no decimal point) when there are none. Ex. when rounded to 2 decimal places 2.75 should show as 2.75 2.50 should show as 2.5 2.00 should show as 2 Thanks Jay well ... for number display formats, the # represents a number and 0 represents a required number so ... #.## should be what you're looking for Jim On 6 Feb 2008 09:26:12 -0800, in sybase.public.powerbuilder.general <Jay> wrote: >Can anyone describe how...

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 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 indic...

Format numbers in formview so that decimal points line up
How do I format the numbers in a FormView control (and presumabaly in the other databound view controls) so that the decimal points line up? I'm displaying data using asp:label controls and for formatting I've used the curly bracket format with Eval: Text='<%# Eval("ClearedBalance", "{0:n2}") %>' Although this nicely presents numbers with a decimal point and two digits after the decimal point, everything is left justified, which means the decimal points don't line up if there are a mix of numbers less than ten, over ten, over a hundred etc. I can't find a way of right justifying the...

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...

String.Format comma for thousands and two decimal points only
I am trying to come up with the String.Format expression to format a number that will have a comma to separate the thousands and a period for the decimals ( I want to show only two decimals ) Will this work for you? String.Format("{0:N2}", MyNumber)Thanks, EdMicrosoft MVP - ASP/ASP.NET...

Web resources about - Supress Decimal Point in format - sybase.powerbuilder.datawindow

Libya no longer can supress the Berbers
Marginalised under the Muammar Qaddafi regime the Amazigh people, the traditional Berbers of norther Africa are back culturally.

New 'subconscious mode' could improve smartphone battery life, supress your WiFi id
Researchers at the University of Michigan have figured out a way to drastically increase your cellphone's battery life, at least while using ...

Cloudy With A Chance of Meatballs 2, an animated film starring Bill Hader’s voice and Tacodile Supre
Cloudy With A Chance of Meatballs 2 , an animated film starring Bill Hader’s voice and Tacodile Supremes , topped the weekend box office with ...

Sentinels supress 'international turmoil' in 'X-Men: Days of Future Past' image
X-Men: Days of Future Past reveals a promotional image from Trask Industries trumpeting the capability of the mutant-hunting Sentinel robots ...

India cannot supress fundamental rights: Google India to HC - The Times of India
Google India today told the Delhi high court that blocking them was not an option as a democratic India is not a "totalitarian" regime like China. ...

supre cool
We come from the future.

Amazon Tablet Should Supress its Android Roots to Beat iPad
What pops into your mind when you hear the word” tablet?” Without a second thought, iPad is the thing you first thought of, right? Well, this ...


The Best Supre Bowl Commercial
The Best Supre Bowl Commercial

Immigration case could end up before Supre...
... Thursday that the legal battle over President Obama’s executive actions on immigration could ultimately end up before the U.S. Supreme Court ...

Resources last updated: 1/20/2016 1:50:45 AM