x
Solved

# Handle significant figures in VB.NET

Posted on 2004-09-28
Medium Priority
677 Views
Dear all,

I am trying to handle calculation between numbers, with 25 significant figures (e.g. 123456.7890123456789012345) and seems even double can not handle figures like that.

Are there any simple way in VB.NET to handle these kind of numbers? except cut the numbers into parts.

Thanks.

Regs,
Bezier
0
Question by:bezier98

LVL 9

Accepted Solution

checoo earned 1000 total points
ID: 12167767
use decimal it can handle upto 28 significant figures
0

LVL 10

Assisted Solution

123654789987 earned 1000 total points
ID: 12168389
The decimal data type

decimal data type variables can store 1 times 10 to the 28th 1.0 × 10-28 and 7.9 times 10 to the 28 th 7.9 × 1028 in 128 bit. If you think about this type you will note that it has a greater precision and a smaller range and that’s we exactly needs for financial calculations also note that decimal data type has a Precision of 28-29 significant digits.
0

Author Comment

ID: 12214604
Acutally I did use decimal type, but at the begining, it doesn't work, but now I know the reason.

I try the following

Dim x as decimal

x = "123456.7890123456789012345"
msgbox (x + 0.0000000000000000001)

the result will turn out to be 12345.789012346

which I think VB treated 0.0000000000000000001 as double

After assigned 0.0000000000000000001 to another decimal y, then
msgbox(x + y) will give the exact answer

Anyway, thanks for helping

Bezier
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Join & Write a Comment Already a member? Login.

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…
Watch the video to know the process of migration of Exchange or Office 365 mailboxes in absence of MS Outlook. It is an eminent tool which can easily migrate Public, Archive user mailboxes from one another Exchange server and Office 365. Kernel Migr…
###### Suggested Courses
Course of the Month4 days, 22 hours left to enroll

#### 579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.