473,320 Members | 1,979 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,320 software developers and data experts.

custom format for date and decimals

Hi there;

I m trying to find a way to create some sort of helper or something so
all dates and numbers are displayed in a format (perhpas taken froma
config file or database)
for example in an XML file have date format "dd/MM/yyyy hh:mm" and
decimals with 2 places
How can i do this whitout changing the existing code too much? (ie
having to go to each date field and add "ToString(...)..."
Cheers

Oct 1 '07 #1
2 1539
Without changing the current culture, you'll have to specifically use a
format string with ToString(...).

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"roundcrisis" wrote:
Hi there;

I m trying to find a way to create some sort of helper or something so
all dates and numbers are displayed in a format (perhpas taken froma
config file or database)
for example in an XML file have date format "dd/MM/yyyy hh:mm" and
decimals with 2 places
How can i do this whitout changing the existing code too much? (ie
having to go to each date field and add "ToString(...)..."
Cheers

Oct 1 '07 #2
On Oct 1, 3:59 pm, Peter Ritchie [C# MVP] <PRS...@newsgroups.nospam>
wrote:
Without changing the current culture, you'll have to specifically use a
format string with ToString(...).

--
Browsehttp://connect.microsoft.com/VisualStudio/feedback/and vote.http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#

"roundcrisis" wrote:
Hi there;
I m trying to find a way to create some sort of helper or something so
all dates and numbers are displayed in a format (perhpas taken froma
config file or database)
for example in an XML file have date format "dd/MM/yyyy hh:mm" and
decimals with 2 places
How can i do this whitout changing the existing code too much? (ie
having to go to each date field and add "ToString(...)..."
Cheers- Hide quoted text -

- Show quoted text -
it doesnt look like current culture is what I m looking for, it seems
like it will have non required effects.
Any ideas?

Oct 1 '07 #3

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

Similar topics

7
by: netclectic | last post by:
Hi folks, i've searched and searched and can't find any example of what i'm trying to do. Essentially (i think) i need to add a new operator to Number. I'm using eval to evaluate expressions...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
6
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base...
1
by: Rich | last post by:
Hello, I have some datefields in a dataset (ds1). I bind some textbox controls on a windows form to these date fields in ds1, but I only want to see 01/01/2004 instead of 1/1/2004 8:00:00 AM. ...
6
by: Piotr | last post by:
Hi, I have following problem: I use a form in excel to send data into mysql server, everything is ok unless I have to deal with decimals or data fields, this simple are not recognized. For...
7
by: Dag Sunde | last post by:
I want to use the format-number function to output a number with a specific number of decimals, based on the content of a node... Is there any smart way to generate differnet strings based on a...
6
by: Gretsch | last post by:
Hi, I have some XML data which contains a date in dd/mm/yyyy format (ie UK date format). In javascript I need to read this date then calculate the age (in days& decimals) of the XML data. I...
4
by: phpmagesh | last post by:
Hi, I have to show system date in custom format For example: 2009/Oct/06 I want to show date in above format. how to get this output . i used the below format
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.