473,480 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Formatting number with two decimal places

Hello

I need to have a value display in a label with two decimal places; e.g. "4" to display as "4.00

Any help will be appreciated

Sandy
Nov 20 '05 #1
3 28835
"Sandy" <an*******@discussions.microsoft.com> schrieb

I need to have a value display in a label with two decimal places;
e.g. "4" to display as "4.00"


dim d as decimal
dim s as string

d = 4
s = d.tostring("0.00")

I assume you store numeric values in numeric variables.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


Nov 20 '05 #2
Hi Armin

Thanks so much for your response

I'll try this tomorrow

Sand

----- Armin Zingler wrote: ----

"Sandy" <an*******@discussions.microsoft.com> schrie
I need to have a value display in a label with two decimal places

e.g. "4" to display as "4.00"


dim d as decima
dim s as strin

d =
s = d.tostring("0.00"

I assume you store numeric values in numeric variables

--
Armi

How to quote and why
http://www.plig.net/nnq/nquote.htm
http://www.netmeister.org/news/learn2quote.htm

Nov 20 '05 #3
Thanks, Armin - it worked great!
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2688
by: ian | last post by:
Hi guys, i'm trying to format the output of a record in access, which i am pulling from through php (odbc) and the formatting is set at 4 decimal places, which i don't want. i want currency and no...
3
146401
by: David Sharp | last post by:
I'm trying to find a way to format a FLOAT variable into a varchar in SQL Server 2000 but using CAST/CONVERT I can only get scientific notation i.e. 1e+006 instead of 1000000 which isn't really...
36
7771
by: Andrew | last post by:
I trying to format my output to display a set number of decimal places. I have been trying to use the <iomanip> setprecision(), but that will only display the total number of digits. Can someone...
7
12682
by: Chris | last post by:
Where can I find a fairly comprehensive list of the formatting codes used when data binding. e.g. <%# Bind("Debit", "{0:C}") %>. Specifically formatting a number to 2 decimal places. Regards, Chris.
14
4235
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
19
3559
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
17
5255
by: scan87 | last post by:
Can somone please, please give me the solution for the following problem. I need to submit it on Monday. Write a global function called format, which formats numbers with a given number of decimal...
3
2482
by: Nathan Sokalski | last post by:
I am using databinding to populate a dropdownlist with numeric values. Some of the values have more decimal places than others, and I only want the minimal number of decimal places necessary...
9
2304
by: john coltrane | last post by:
Is there way to create a formatted string in a similar that is similar to sprintf? The same for printing, printf? C,D,E,F,G,N,X for currency, decimal, exponential, fixed, general, numerical,...
2
11875
Pittaman
by: Pittaman | last post by:
Hello I am creating some crystal reports (for visual studio 2005) based on the content of certain .NET objects. I'm doing this in .NET 2.0. For one of them I'm using a Cross-table to summarize...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7045
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7087
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.