decimals

Hi,

how to get exact  decimal value    in asp.net  example   i am giving as pice   326.50 but  it changes 327

i want to display only  326.50  not 327

please send some sample examples


Regards,
Kannandesikan
0
Kannandesikan
3/14/2008 7:27:44 AM
asp.net.getting-started 91979 articles. 3 followers. Follow

8 Replies
308 Views

Similar Articles

[PageSpeed] 37

i think u r assiging 326.50 to an "integer" type veriable or your field type is integer in ur database

0
mr_talha
3/14/2008 10:28:29 AM

What data type are you using to store the value 326.50?

Because if you are using a DECIMAL data type it would store it as 326.5 and would not truncate the decimal. It sounds like you are using a INTEGER type. 

0
jimmy
3/14/2008 10:43:58 AM
yes iam using integer type
Regards,
Kannandesikan
0
Kannandesikan
3/14/2008 11:21:51 AM

Kannandesikan:
yes iam using integer type
 

Use a decimal data type and it would all work

You should only use integers for whole numbers. 

0
jimmy
3/14/2008 11:25:33 AM

dim tmp as decimal=326.50

 


If this post was useful to you, please mark it as answer. Thank you!

Regards.
mimranshafiq
.NET Web Developer
http://www.dotnetclassic.com
0
M
3/14/2008 11:36:03 AM

Hi 

For this the variable is should be declared as a Floating-Point Number. You can use either of the below method

Single-Precision

    Dim number As Single = 128.68
Double-Precision 
    Dim distance As Double = 287.04

Decimal 
   Dim YearlyIncome As Decimal = 82455.42
 
hope this will help for you 

 

0
CoolBond
3/14/2008 11:53:29 AM

u can also use float datatype..


Regards,
Punithkumar
0
Punithkumar
3/14/2008 12:03:48 PM

Kannandesikan:

yes iam using integer type

Hi Kannandesikan,

Try this way instead

double value = 10000;
string str= value.ToString("#,###.00");

This would out put 10,000.00

double value = 10000;
string str = String.Format("{0:c}", value);

Output would be $10,000.00

 


Regards,Vinz

"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
0
vinz
3/14/2008 1:36:01 PM
Reply:

Similar Artilces:

how to get start with .NET
the net help people installed  to my desktop 1-microsoft visual studio .NET enterprise developer 2003 2-microsoft .NET framework 1.1 what else do i need ...???  and how can i try with some simple code in VS.Net and run it to see wat happen...????? please help If you want to develope web applications, then you'll also need IIS on your PC.  That'll require XP-Professional or Windows 2000/2003, but XP-Home edition won't allow IIS installation. As for how to get started, you can search the web for some tutorials or buy a good book on VS.  The topic is way too vast to...

Getting Start With .net
hi i'm intersted to learn asp.net (vb or delphi) . i programming with delphi6 but i'd like to tp know something about programming in internet specially with .net . i hear about microsoft.net with delphi 7 that i can programming with delphi in .net .... is it right ? what 's our opinian about it ? and better to learn Vb.Net or continu with delphi(or delphi.net) thanks. Ali Darabian I think there is some support for Delphi in .Net. However, you will find much more support from the user community if you choose a more popular language such as VB.Net or C#. Since your al...

Where to start and how did you get started?
Hi, I have had a feeling for a long time to jump into the adds market for some time due to my low income (shooting for the stars) and I don't have anything better to do these days. But I find it really difficult not to give up due to lack of guides (what I can find atleast) and all the hard words which only makes me confused. But I won't give up. Never. Not sure if this is the right place to post this, but I deffinitly would be really greatfull for help getting started. How did you get started? +If there are any teacher that wanna show me the ropes private, I can give payment with ...

Getting started with JScript.NET
I'm a Javascript and Actionscript developer, and the thought of being able to do server-sides in something I know was too good to resist. Does anyone know some good tutorials for developing ASP.NET pages in JScript?  I can find lots of console code, but simple things are hard: like I can't even figure out how to print something out to the web page (just a string). What I'm really trying to do is access a database, verify a login, and print JSON out to the response.  What should I do to start?  Is there a better way to do this? (IE: using some JSON library already?). I'm commun...

Getting started .net website
Hi folks,Does anyone here know of a good website to just sit back and read for learning .net? Thanks in advance.Baldeep Right here... Click the Get Started and Learn sections here. Quite a few out there - - this one, has a lot of good videos -  also ASPNet101.com, but then, I might be a little prejudiced David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(P...

How do I get started with AJAX.Net?
Hi All, I'm a seasoned asp.net developer but have not yet ventured into atlas et al.  I prefer books, but will take whatever I can get if it's good and will get me going. Any recommendations? Thx in advance. Jeff try here first http://ajax.asp.net/downloads/default.aspx?tabid=47 then learn from sample and docJames Wu (MIB426).NET is only way to goMCP, MCSE, MCDBA, MCSD, MCAD I find the materials online display features and implementations but are lacking architectural depth, and am seeking more comprehensive resources. By architectural depth, I mean that I cannot watch ...

Getting Started with .net and a few questions
Hello I've done some asp and php programming along with various other languages in the past and slowing getting my head around .net.I have a small project of creating a Holiday Booking system on our Intranet and just trying to get the first part to work properly will hopefully get me sorted for the whole project. The Intranet is running on .net 2 and I prefer to use the VB code rather than C#. This is connecting to an SQL server.My initial page that I am trying to create is just for an admin user to view which dates in a table have been specified as Bank Holidays and be able to add ...

Getting Started Without VS.NET
Hi all, does anyone know how any online resources that can show me how to create web apps that include code-behind, and uer controls without using VS.NET? I have VS.NET in work, but would also like to do work at home, but cannot install VS.NET on my home laptop because I simply dont' have the space or processor power. Any online articles would be welcome, as will any open-source apps - I currently have SharpDevelop, but I find it unstable as it crashes my laptop alot of the time. Thanks Tryst Did you try Web Martix? It is a FREE tool from Microsoft.Regards, Narayana ...

Newbie Question
I have a new project which has just started. One of the requirements is to generate XML files. Do I have to create schema files? Does anyone have a tutorial or sample code to help me get started. I have some background using XML, but not in .NET. Thx Mark How to create a new xml file with XmlDocument? More examples hereSonu Kapoor [MVP] Feel free to ask me any .NET question | Ajax Data Controls Forum Thanks, this is very helpful. What do I need to do extra to setup the schema for this xml file? Is the schema really necessary as well? Thx Mark You dont need to define any sc...

Getting started with mySQL Connector/Net 5.1
i have a vs2005 project which someone else built.  I need to connect to mySQL in this project. it is currently using the OleDbConnection to mySQL and I cannot make the connection, so I was told by the developer to try the the mySQL Connector/Net 5.1.  I have read the very encouraging documentation.  I am in a file called SqlDataProvider.vbI want to replace Dim objConnection As OleDbConnectionwithDim objConnection As MySqlConnection I get the blue squiggly  "MySqlConncection is undefined." I added this import to the top. Imports MySql.Da...

Getting started with .net mobile/wireless application programming
Hi friends, I am very much amateur to the world of mobile/wireless application programming that's why m is having thousands of doubts and confusion regarding the technology. My first few concerns about the terms i.e. mobile web applications vs. windows mobile applications first thing are these 2 things are same if not what are the main differences. I hope you will also show me some light how to move further ahead in this field as i m having small exp approx. 1.5 yrs in Asp.net application. Any help in the form of links, URL, code will be highly appreciated. Thanks in advanced...

getting start with vb.net and crystal repots(web form)
I use Crystal Report9 in Visual Studio.NET 2003..... Example at Northwind database I want a application that.....a form include a combobox that contain CustomerID.....If I choose one CustomerID and click OK button....a Report will display information about this Customer......I think that must use Paramater.....how to do that ???? (How do I start to coding --please step by step or sample) please help me !!! Thank you so much!!! very good I have Dropdownlist when I choose the 'month'--> the all data of this field will show I use this Private Sub ddlMonth_Sel...

Getting 3.1 to start in debug mode in vs.net 2003.
  Hi All, I have a run time version of dnn installed and working at D:\Inetpub\wwwroot\dotnetnuke on my laptop. I want to be able to learn how to write DNN modules etc and so I have installed the source code in D:\Inetpub\wwwroot\dotnetnuke3100\. I set the debug flag in web.config to yes..... as in the lines.. <!-- set debugmode to false for running application --> <compilation debug="true" /> I updated the solution file D:\Inetpub\wwwroot\dotnetnuke3100\Solutions\DotNetNuke.All to look at localhost/dotnetnuke3100 which is my source code version. I have created the...

Free .Net and Sql Server Training Videos for Developers just getting started
I figured since this is the Getting started forum I would mention a great .Net training video site with some free videos.http://www.TechnicalVideos.netThanksMike James...

Truely just getting started, so where should I start?
I've already been working a thread on a good reference/learning book.  but truely I'm just getting started.  I've a background with HTML and some CSS But this is my first foray into any sort of application language.  I've had an interest in PHP and ASP but have only recently started to make the effort to learn.  I'm starting with the videos available here and they are great for learning the development application but I've not the programming background to easily absorb some of the more programming based processes.  I've no college resources where I'm at other than o...

Web resources about - decimals - asp.net.getting-started

Decimal representation - Wikipedia, the free encyclopedia
Proof: Let , where . Then , and the result follows from dividing all sides by . (The fact that has a finite decimal representation is easily ...

Dewey Decimal Classification - Wikipedia, the free encyclopedia
This highly organized system categorizes books on library shelves in an efficient, specific and repeatable order that makes it easy to find any ...

Fraction Calculator + Decimals to Fractions Converter on the App Store on iTunes
Get Fraction Calculator + Decimals to Fractions Converter on the App Store. See screenshots and ratings, and read customer reviews.

Dewey Decimal Tattoo - Flickr - Photo Sharing!
Children's librarians represent.

Math of the Day: Sesame Street’s The Count Reads Pi to 10,000 Decimal Places
... has created a true monster out of your favorite Sesame Street vampire, with audio of The Count reading every digit of Pi out 10,000 decimal ...

UPDATED: Paul Harapin heads Decimal Software as CEO
Former VCE Asia-Pacific boss, Paul Harapin, has confirmed he is the new chief executive officer (CEO) of Decimal Software.

It all makes sense now – the early days of dollars and cents in Australia as decimal currency turns 50 ...
Sunday will see the 50th anniversary of the introduction of decimal currency to Australia.

Feeling green: the dangers of decimal currency
The curious case of possibly toxic coins, via Austria and a devastatingly original idea for Canberra.

50th anniversary of decimal currency: some early dollar bills worth $1500
It's 50 years this week since Australia introduced decimal currency but only some early specimens are worth anything more than face value.

Jobless Rates With Another Decimal
The BLS reported a jobless rate of 8.3% for both January and February. Adding an extra decimal, the unemployment rates would actually be 8.26% ...

Resources last updated: 2/12/2016 12:34:31 PM