Formatting numbers without leading zeros

Hello everyone.

I have problems with formatting number-columns in a datawindow.
I want to display the value 12.3456 as an area using the format "#,##0.00
m�". I expect it to be "12,35 m�".
But it is displaid as "0.012,35 m�", that is with leading zeros.
Replacing "m�" by any other string always displays the number with leading
zeros.
Except for signs of currencies, as dollar ($) and euro (?).
Using these signs with the same format ("#,##0.00 $") displays the number as
"12,35 $" (which I would prefer).

Why is this so? How can I get rid of the leading zeros?

Thanks.


-- 

Rolf Knaden
conject GmbH, c/o Business-Contor Philosophenweg 31-33, 47051 Duisburg

Fon:    +49 (0203) 9414.138
Fax:    +49 (0203) 9414.555
Rolf.Knaden@conject.com

www.conject.com

konsequent conject.


0
Rolf
3/3/2005 12:52:18 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

4 Replies
1566 Views

Similar Articles

[PageSpeed] 19

If you look in help there is only certain
characters you can put in an edit mask.
m=b2  is not in my help and when I use
it, it doesn't work.  what version are
you using so that it returns: 0.012,35 m=b2
When I use that format it ruturns
0,0012.35 m=b2

If you want to display the number as
then I would create a computed field
and format it the way you need to.
Example create a computed field:
string(newrate ,"#,##0.00")+" m=b2"



> Hello everyone.
>
> I have problems with formatting number-columns in a
> datawindow. I want to display the value 12.3456 as an area
> using the format "#,##0.00 m=b2". I expect it to be "12,35
> m=b2". But it is displaid as "0.012,35 m=b2", that is with
> leading zeros. Replacing "m=b2" by any other string always
> displays the number with leading zeros.
> Except for signs of currencies, as dollar ($) and euro
> (?). Using these signs with the same format ("#,##0.00 $")
> displays the number as "12,35 $" (which I would prefer).
>
> Why is this so? How can I get rid of the leading zeros?
>
> Thanks.
>
>
> --
>
> Rolf Knaden
> conject GmbH, c/o Business-Contor Philosophenweg 31-33,
> 47051 Duisburg
>
> Fon:    +49 (0203) 9414.138
> Fax:    +49 (0203) 9414.555
> Rolf.Knaden@conject.com
>
> www.conject.com
>
> konsequent conject.
>
>
0
Dawn
3/3/2005 6:57:21 PM
I am using the format "#,##0.00 m�" and it shows "0.012,35 m�". I am using a
german system, so the decimal-delimiter is "," and the thousand-delimiter is
"." .
What I can't understand, why does it show the leading zeros? According to
the format it shouldn't do!
And another strange thing is. When moving the "," in the format, the "."
moves in the display also.
For example "#,#,#0.00 m�" shows "0.0.12,35 m�". So it seems not to be a
"real" thousand-delimiter anymore.

<Dawn T Brown Eyes[TeamSybase]> schrieb im Newsbeitrag
news:42275e11.3665.1681692777@sybase.com...
If you look in help there is only certain
characters you can put in an edit mask.
m�  is not in my help and when I use
it, it doesn't work.  what version are
you using so that it returns: 0.012,35 m�
When I use that format it ruturns
0,0012.35 m�

If you want to display the number as
then I would create a computed field
and format it the way you need to.
Example create a computed field:
string(newrate ,"#,##0.00")+" m�"



> Hello everyone.
>
> I have problems with formatting number-columns in a
> datawindow. I want to display the value 12.3456 as an area
> using the format "#,##0.00 m�". I expect it to be "12,35
> m�". But it is displaid as "0.012,35 m�", that is with
> leading zeros. Replacing "m�" by any other string always
> displays the number with leading zeros.
> Except for signs of currencies, as dollar ($) and euro
> (?). Using these signs with the same format ("#,##0.00 $")
> displays the number as "12,35 $" (which I would prefer).
>
> Why is this so? How can I get rid of the leading zeros?
>
> Thanks.
>
>
> --
>
> Rolf Knaden
> conject GmbH, c/o Business-Contor Philosophenweg 31-33,
> 47051 Duisburg
>
> Fon:    +49 (0203) 9414.138
> Fax:    +49 (0203) 9414.555
> Rolf.Knaden@conject.com
>
> www.conject.com
>
> konsequent conject.
>
>


0
Rolf
3/4/2005 7:14:18 AM
> I am using the format "#,##0.00 m�"

try "#,##0.00\ m�"
or
"#,##0.00\ \m\�"

HTH
--
Strider


0
strider5
3/7/2005 3:53:59 PM
Hey!!! That's it.
Thank you very much.
Rolf
"strider5" <strider5@strider5.com> schrieb im Newsbeitrag
news:422c7917@forums-1-dub...
> > I am using the format "#,##0.00 m�"
>
> try "#,##0.00\ m�"
> or
> "#,##0.00\ \m\�"
>
> HTH
> --
> Strider
>
>


0
Rolf
3/7/2005 4:50:53 PM
Reply:

Similar Artilces:

Formating number without leading zeros
Hello everyone. I am using PB 9.0.1 Build 7275. I have problems with formatting number-columns in a datawindow. I want to display the value 12.3456 as an area using the format "#,##0.00 m�". I expect it to be "12,35 m�". But it is displaid as "0.012,35 m�". That is, with leading zeros. Replacing "m�" by any other string always displays the number with leading zeros. Except for the euro (?) or dollar ($). Using these signs with the same format ("#,##0.00 ?") displays the number as "12,35 ?" (which I would prefer). Why is t...

format number with leading non-zero
Hello, I want to format a number to become a 9 digits representation, every= time it must have an integer 1 at the front.=0A=0AE.g =0A123 become 100000= 123=0A123456 become 100123456=0A=0AIf I use sprintf I can only make it to h= ave leading zero such as sprintf("%09d", $number);=0A=0AThanks.=0A=0AWillia= m=0A=0A=0ASend instant messages to your online friends http://uk.messenger.= yahoo.com Just insert the literal digit in the format and trim the size accordingly. sprintf("1%08d", $number); Bob McConnell -----Original Message----- From: William [mailto:e...

Format leading zeros?
How can I format a value to always be seven digits with leading zeros? ie: select number from table where it will come out as: 0000007 0000077 0000777 etc. Thank you. BTW _ I know I can do this with a hefty CASE statement but I was looking for something easier. -Robert "Robert Paresi" <FirstInitialLastName@innquest.com> wrote in message news:470ea531$1@forums-1-dub... > How can I format a value to always be seven digits with leading zeros? > > ie: > > select number from table > > where it will come out as: > ...

Zero is not a number for datawindow.
I want to use editmask field for numeric values representing floors in a building.The problem is that no mask allows me to enter 0 (zero) representing ground floor.I need to show the diffrence between the ground floor and the lack of the information about the floor. The mask "###0" is not the solution because null value is shown as 0 (zero) and if I use such a mask, enter any number and delete it I will always have the 0 (zero) shown. Please help me, I am starting to believe that the PowerBuilder is good for nothing. ...

Pad Number with Leading Zeros
------_=_NextPart_001_01C146C3.16F952D0 Content-Type: text/plain; charset="iso-8859-1" Hello. Is there a way to pad a number with leading zeros with 1 command rather than the 2 I used below? It looks like you're supposed to be able to zero-fill with sprintf but I couldn't figure it out. #!/bin/perl -wd $f = 1234; $g = sprintf "%6s", $f; $g =~ s/ /0/g; print "$f\n"; print "$g\n"; ~Carl ------_=_NextPart_001_01C146C3.16F952D0-- ------_=_NextPart_001_01C146C7.025BA040 Content-Type: t...

XSLT, format-number and zero
i use in xslt format-number <xsl:decimal-format decimal-separator="," grouping-separator="."/> at start of doument (it is corect, i'm not american) and in document <xsl:attribute name="sdex"><xsl:value-of select="format-number(./client/name/adr/birth/items/sdex, '###')"/></xsl:attribute> and my problem is, that when there is zero, format-number method returns empty, but i need it to return 0 number. have some ideas?Ales Ruzicka18 years old Czech student & cleaner :)interested in internet technologiesmyBlog Re...

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

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

[Patch] to format for Zero Padded Numbers
--simple boundary Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Description: "cc:Mail Note Part" Since my original posting generated deafening silence, here are patches to enable zero padded numerics in Perl format lines. Context diffs to patch form.h, pp_ctl.c, t/op/write.t and pod/perlform.pod attached. Extracted from patched perlform.pod: ------------ As an alternate form of right justification, you may also use "#" or "0#" characters (with an optional ".") to specify a numeric field. This way you ...

format number as a percent without rounding?
I am trying to display a number as a percentage.  From SQL, it is coming in as .99998.  So, when I do: string.Format("{0:P2}" I am getting 100.00% displayed.  I don't want it to round up to 100 - I want it to display 99.99%.  Is this possible?Thanks! One solution (with 'd' being the number 0.99998) string.Format("{0:P2}", Math.Truncate(d*10000) / 10000)JasonFA View Inside My Head...

What are proper format strings for String.format, Number.format, etc?
Hi guys, I just started using the client side version of the Ajax framework. Everything is working out so far, except that I can't seem to be able to format any strings of numbers the way I want. Wheather I use the String.format or Number.format functions, I just keep getting Sys.FormatException errors. What are the proper format strings? I tried the relevant ones that I use in C#, but it just doesn't work.Help would be much appreciated!  I believe D, C, N, and P are the only valid ones for numbers (client side).Encosia - ASP.NET, AJAX, and more.Latest article: Using complex ...

Re:[Patch] to format for Zero Padded Numbers
--simple boundary Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Description: "cc:Mail Note Part" Oops, new copy of t/op/write.t patch; I forgot to change the number of tests at the top of the file. John Peacock --simple boundary Content-Type: text/plain; charset=US-ASCII; name="write.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="write.patch" *** t/op/write.orig Wed Feb 9 19:51:55 2000 --- t/op/write.t Fri Apr 7 13:27:39 2000 *************** *** 1,6 **** #!....

Number Format and String Format ?
Suppose I have a number "1", how can change the number format to "001" ? How can I convert the number "1" into string format "001" ? Thx for your help ~ :) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconnumericformatstrings.asp int x = 1;Response.Write(x.ToString("000"));Steven A SmithAspAlliance.com - The #1 ASP.NET CommunityDevAdvice.com - Answers to Questions If you got your data from SQL Stored Procedure, you can do the formating in your query: RIGHT('000' + CAST(Col1 AS varchar), 3) -- Tough People Do Tough Task -- It works ~ Thank you ve...

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

Web resources about - Formatting numbers without leading zeros - sybase.powerbuilder.datawindow

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/24/2015 4:03:19 AM