473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How do i set the decimal points in for a datacolumn?

I have following code in C#.NET

m_strTableName = "AFE";
m_dataTable = new DataTable(m_strTableName);
DataColumn dc;
dc = m_dataTable.Columns.Add(COL_DEPTH, typeof(Double)); dc.DefaultValue
= 0.00; dc.Caption = COL_DEPTH + " (ft)";

I want to display datavalue for this colum up to two decimal points
also i want to set the allignment of the Column Header to "Center" and
and for its Text to "Right"

Waiting for quick reply
Nov 2 '07 #1
2 3532
Kunal Patel wrote:
I have following code in C#.NET

m_strTableName = "AFE";
m_dataTable = new DataTable(m_strTableName);
DataColumn dc;
dc = m_dataTable.Columns.Add(COL_DEPTH, typeof(Double)); dc.DefaultValue
= 0.00; dc.Caption = COL_DEPTH + " (ft)";

I want to display datavalue for this colum up to two decimal points
also i want to set the allignment of the Column Header to "Center" and
and for its Text to "Right"

Waiting for quick reply
Resposting the same question will not give you a different answer.

You still don't do this in the data table. It only holds the data, and
has nothing to do with how you choose to display the data.

--
Göran Andersson
_____
http://www.guffa.com
Nov 2 '07 #2
Göran Andersson wrote:
Resposting the same question will not give you a different answer.
Maybe he hoped that a new version of .NET had come out since ...

:-)

Arne
Nov 3 '07 #3

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

Similar topics

4
by: Enno Middelberg | last post by:
Hi, I'm sure someone asked this question before, but I can't find the solution on the web or in the groups. I want to print out columns of numbers which are aligned at the decimal point,...
17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
7
by: hana1 | last post by:
Hello experts, I used to program in C/C++ and now switched to Java. I am having a difficulty that I need your help with. How can I limit a double variable to hold 2 decimal points only? Say I...
15
by: Kay Schluehr | last post by:
I wonder why this expression works: >>> decimal.Decimal("5.5")**1024 Decimal("1.353299876254915295189966576E+758") but this one causes an error 5.5**1024 Traceback (most recent call...
0
by: Sam | last post by:
I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data type of 'Money...
1
by: ianhen | last post by:
Hi I have a Web Form which I need to get results shown to 2 decimal points only. In the Head I have: - function heatoutput() { var vWidth=document.heatcalculator.roomwidth.value; var...
0
by: apple27 | last post by:
Hi, Appreciate your guys help.. Im a newbie in OWC.Trying to search for OWC objects to complete a few charts. Still having difficulty on this :- My questions: 1. I need to come out with a...
3
neo008
by: neo008 | last post by:
Hi all, I am using some variables as "Double" and some text boxes set "DataFormat" property to "Number with two decimal points" for currency calculations. I perform some typical mathematical...
5
by: =?Utf-8?B?S3VuYWwgUGF0ZWw=?= | last post by:
I have a DataTable with Column DataType as Double I just want to show data in C# datagrid with two decimal places which property do I set for DataColum of DataTable and How? Thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.