473,498 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fixed point decimal

I am doing calculations on numbers and then I want to display them in a datagrid that always has 2 decimal places. I am doing something like

Dim Size As Decimal
Dim Space As Decimal
...
...
...
Size = Decimal.Round(Size, 2)
Space = Decimal.Round(Space, 2)

If the number happens to round to say 95 I want it to display as 95.00. How can I do that?

Thanks in advance.
Christel
Nov 22 '05 #1
1 1468
Hi Christel,

Take a look at Binding.Format Event.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Christel" <an*******@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
I am doing calculations on numbers and then I want to display them in a datagrid that always has 2 decimal places. I am doing something like
Dim Size As Decimal
Dim Space As Decimal
.
.
.
Size = Decimal.Round(Size, 2)
Space = Decimal.Round(Space, 2)

If the number happens to round to say 95 I want it to display as 95.00. How can I do that?
Thanks in advance.
Christel

Nov 22 '05 #2

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

Similar topics

26
9631
by: Adrian Parker | last post by:
I'm using the code below in my project. When I print all of these fixed length string variables, one per line, they strings in questions do not properly pad with 0s. strQuantity prints as " ...
5
6742
by: Abe Simpson | last post by:
Hello all, The application I am working on must never output numbers in a floating-point format, that is, something like 2e-002 is a big no-no. At the same time, it must output numbers in a...
4
7824
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
1
321
by: Christel | last post by:
I am doing calculations on numbers and then I want to display them in a datagrid that always has 2 decimal places. I am doing something like Dim Size As Decimal Dim Space As Decimal ... ......
1
15461
by: Mike MacSween | last post by:
This looks like a bug to me. I have an expression on a report: =Format(Sum((**)*(/)),"0.00") Score is byte PercentOfGrade is double PropDegree is single ModuleCats is byte
10
3204
by: August Derleth | last post by:
Cause I made such a hash of my first attempt, and in an effort to provide PORTABLE code to solve the problem, I submit this solution to convert to and from BCD values stored in longs. This should...
9
4158
by: pout | last post by:
What are the purposes of fixed-point? When should it be used? I read: #define Int2Fixed(x) (((long)(short)x) << 16) and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to...
3
2213
by: Xavier Wargny | last post by:
Hi all and each! Since july, I'm working with dot NET technology. Confident with brand new tools it gave, I decided to use that new decimal type (related with the Database type...). After many...
2
1876
by: Rob Clewley | last post by:
Dear Pythonistas, How many times have we seen posts recently along the lines of "why is it that 0.1 appears as 0.10000000000000001 in python?" that lead to posters being sent to the definition...
0
7168
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
7210
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...
0
7381
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
4916
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
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
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.