473,407 Members | 2,315 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,407 software developers and data experts.

What data type would be best for storing the money formatb of data in C#?

Hi,

I am working on a website which is supposed to deal with users bank transactions. As it is going to deal with money on a higher scale. I want to know what will be the best fit data type for storing the money values in C# language such that the maximum memory utilization and performance can be get.

Thanks,

Dev
Jun 14 '11 #1
2 1975
Joseph Martell
198 Expert 128KB
If you are restricting yourself to built-in data types then my initial thought would be decimal. It is not the most compact, but it has the highest range and accuracy of any floating point type in the .Net framework.

It is also possible to create your own fixed-point class that doesn't have the same accuracy problems that a floating-point data type has. I have read several articles and programming books where the other details a scenario where they needed to do this to deal with financial information.
Jun 17 '11 #2
Hi,

The data type to use can be decimal or double depending upon the range and precision of data to store. double will enable you to store larger range of data. Moreover the precision will also be better. The typical synatx that you can use is as follows:

double amount=12.2323232;
label1.Text= amount;

More details for the same can be found at the below link:

Hope this solve your problem..
Jun 19 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: John | last post by:
Hi, I have an application that receives data (floats) via a socket. My job is to receive the bytes, byte-swap them and convert them to floats, and make them available to the application. The...
0
by: Mike | last post by:
Hi All, I'm writing an application that is accepting data from possibly 100's of clients. The amount of data I get is around 3 or 4 KB per second per client. The data that is streamed from the...
2
by: Amil | last post by:
Hi all, I call a stored procedure that returns a bunch of output parameters. And all of those are nullable data. Is this the best approach to validating the value? I don't want the value checked...
2
by: dbuchanan | last post by:
Hello, Windows forms & database What are the considerations when choosing how to display reference information from the calling form? What is recommended? Table1 is the parent of Table2. ...
0
by: ar | last post by:
What is the best way to return data from web service created in .NET: in recordset, in array, in hashtable or in any other collection? The web service will be created in either VB.Net or C# based...
3
by: Mejmeyster | last post by:
Hi Everyone, I have a table in which one of the text fields has become too small (since it only holds 255 characters). To remedy that, I'm trying to change the data type of that field to "memo"...
4
by: DashaK | last post by:
I am a data base developer. I have to implement SCM system in my department which is Perforce. Our oracle developers never used source control systems before. Does anyone manage oracle schema by...
3
by: charli | last post by:
SQL: SELECT COUNT(month) as c FROM pool WHERE = "GP06NHL" AND = "43.38" AND = "NORMAL UNLEADED" AND = #01/04/2009# Gives 'Data Type Mismatch' because the 43.38 is delimited as a...
6
by: james457 | last post by:
Hi all, I am sending data from a linux application through serial port to an embedded device. In the current implementation a byte circular buffer is used in the firmware. (Nothing but an array...
0
by: Stephen Wallace | last post by:
Hi experts, i want to know what's the best way to export data from spreadsheet to datatable? maybe, any way that can export data from spreadsheet to datatable. Thanks for any answers.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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
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
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...

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.