Comma in format of decimal numbers

Probably the silly question, but I can't seem to find it in help - if a 
query

select price from invoice;

returns value larger than a thousand, e.g. 3580.66

what sort of syntax would present that price value with a comma separating 
the thousand mark, i.e. 3,580.66?


Cheers


0
Vlad
10/1/2010 1:37:44 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

1 Replies
1378 Views

Similar Articles

[PageSpeed] 45

Try casting it as a decimal(13,2) or if you have a Money
data type, use that.



> Probably the silly question, but I can't seem to find it
> in help - if a  query
>
> select price from invoice;
>
> returns value larger than a thousand, e.g. 3580.66
>
> what sort of syntax would present that price value with a
> comma separating  the thousand mark, i.e. 3,580.66?
>
>
> Cheers
>
>
0
Mitch
10/5/2010 5:21:12 PM
Reply:

Similar Artilces:

Format a number to contain commas and to remove decimal places if = .00.
HI there, I am binding data to a gridview & I would like to format a number so that it contains commas and also maintains the numbers after the decimal point BUT if there is 00 after the decimal point it would be removed. Note I dont want to round the number to the nearest integer or to fix to a specifc number of decimal places i.e  1000.00 as 1,000   1000.5  as 1,000.5 1000.66 as 1,000.66  1000.666 as 1,000.666    The best I can come up with is   DataFormatString="{0:n}" but then I would be left with 1000.00 and fi...

Format money MS SQL field data as number with commas and no decimals
If I pull a value from a MSSQL field with is defined as money, how can I get it to display in a textbox with commas and NO decimals? 87000.0000 = 87,000 I can currently remove the decimals like below but is there a way to add the commas as well? decRevenue = drMyData("Revenue") txtRevenue.Text = decRevenue.ToString("f0") It current shows "87000".     http://msdn2.microsoft.com/en-us/library/dwhawy9k(VS.80).aspx...

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

format a decimal number
Hi, How do i specify a decimal number to take only two numbers after the "."? for example:if i have this number in a lable 23.222342114, how do i write my cobe to be displayed only like this 23.22 ?? thanks, use  thenumber.ToString("0.00");...

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

Number/Decimal Formatting Question
"0:#,###.00}"only works when the number is > 1000For Example...0 -> 0999 -> 9991001 -> 1,001.00 Is this a bug?  Or is there another way to do it?Thanks! That is just one of the options try the link below for the whole chart.  Hope this helps.http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstringsoutputexample.aspKind regards,Gift Peddie Are you telling me that I have to actually do an if-then statement to handle numbers >=1000 and rasmasyean:Are you telling me that I have to actually do an if-th...

Format a number with commas in a View
I'm trying to figure out how to format a number in a VIEW to use a "comma" format, i.e. 3427142.23 to 3,427,142.23 Is this possible and if so, what's that syntax? where fieldXYZ is the number. Thanks! I don't think there's a built in function, its usually done by the front end application. There certainly didn't used to be one when I knocked this up: create function CommaThousandsDec (in d double) returns char(40) begin declare rv char(40); declare s char(20); declare t char(20); declare i integer; declare c char(1); declare fract do...

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 numbers -- maximum decimal places?
Stupid number-format question here: I want to format some prices with either zero or two decimal places. 19.9000 -> $19.90 19.9900 -> $19.99 20.0000 -> $20 The only way I can think of doing this is: dim dTemp as decimal dTemp = Decimal.Round(dInput, 2) if Decimal.Truncate(dInput) = dTemp Then return "$" & Decimal.Truncate(dInput).ToString else return "$" & dTemp.ToString end if Is there a better way? have u tried somethign like: String.Format("{0:c}", dInput);Bilal Hadiar, MCP, MCTS, MCPD, M...

datagrid column format to number with comma
Hi, I am trying to format a datagrid column to number format with comma. I have done this many times in many applications but for some reason, this is just not working in my latest application. I am using the DataFormatString property but it returns the number without comma. I even tried the format "{0:#,###}", but same result. I removed the CSS file, still same result. <asp:BoundColumn DataField="Store Quantity" HeaderText="Quantity" ItemStyle-HorizontalAlign=Right DataFormatString="{0:N0}" ></asp:BoundColumn><asp:BoundColumn DataFiel...

how to format number to 4 decimal places
I have a decimal type number in my datagrid that I want to format to 4 decimal places. I tried <asp:BoundColumn ... FormatString="{0:n}" ..../> It give me only two decimal places: 0.28 How can I format my number to display as: 0.2833 (4 decimal places)? Check out this link: http://programmers-corner.com/viewSource.php/123 Met bet is: Console.WriteLine("Number formatting to 4 decimal places: " + theDecNumber.ToString("N4")); HighOnCodingWanna get high!  Try theDecNumber.ToString("###0.0000"); http:/...

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

need help with formatting a decimal number
I have a field that is stored as a float in the database and I have to divide it by 3 when I display it back to the user sometimes I get this: 119.333333333333 How do I format it so it is two decimals or maybe even just drop the decimal all together? Either of these is what Im after: 119.3, 19.33, or 119. Please help. Change for your culture and number of decimal places: // Gets a NumberFormatInfo associated with the en-US culture. NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat; // Displays a negative value with th...

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

Web resources about - Comma in format of decimal numbers - sybase.sqlanywhere.general

Decimal representation - Wikipedia, the free encyclopedia
Proof: Let , where . Then , and the result follows from dividing all sides by . (The fact that has a finite decimal representation is easily ...

Dewey Decimal Classification - Wikipedia, the free encyclopedia
This highly organized system categorizes books on library shelves in an efficient, specific and repeatable order that makes it easy to find any ...

Fraction Calculator + Decimals to Fractions Converter on the App Store on iTunes
Get Fraction Calculator + Decimals to Fractions Converter on the App Store. See screenshots and ratings, and read customer reviews.

Dewey Decimal Tattoo - Flickr - Photo Sharing!
Children's librarians represent.

Math of the Day: Sesame Street’s The Count Reads Pi to 10,000 Decimal Places
... has created a true monster out of your favorite Sesame Street vampire, with audio of The Count reading every digit of Pi out 10,000 decimal ...

UPDATED: Paul Harapin heads Decimal Software as CEO
Former VCE Asia-Pacific boss, Paul Harapin, has confirmed he is the new chief executive officer (CEO) of Decimal Software.

Feeling green: the dangers of decimal currency
The curious case of possibly toxic coins, via Austria and a devastatingly original idea for Canberra.

Jobless Rates With Another Decimal
The BLS reported a jobless rate of 8.3% for both January and February. Adding an extra decimal, the unemployment rates would actually be 8.26% ...

JPMorgan Sued by Trader Over $3 Million Decimal Point
JPMorgan Chase & Co. is being sued by a trader who says he accepted a contract from the investment bank because a typographical error made him ...

.Decimal Archive - Houston Gamer
It was only back in August when newly-formed Houston game studio Orb Interactive launched a Kickstarter campaign for “.Decimal”, a sci-fi take ...

Resources last updated: 12/30/2015 5:40:19 PM