Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 192
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Sikh Philosophy Network » Sikh Philosophy Network » Current Affairs » Information Technology » Decimals rounding without wanting them too.

Decimals rounding without wanting them too.

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Sikh Girl Wanting to Marry White Guy star1119 Love & Marriage 19 10-Sep-2010 19:14 PM
How do I properly display decimals in Access Roger Parsons Information Technology 2 28-Jul-2006 08:30 AM
Add decimals automatically to duplicates munkis29@yahoo.com Information Technology 0 28-Jul-2006 08:14 AM
Decimals In Access TS Information Technology 4 17-Nov-2005 18:03 PM
Removing Decimals and Commas from a value Send Object Command - Two attachments Information Technology 4 11-Nov-2005 20:09 PM


Tags
decimals, rounding, without, wanting, them
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:34 AM
Tdahlman's Avatar Tdahlman
Guest
 
Posts: n/a
   
   
Decimals rounding without wanting them too.

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I have a table and I'm supposed to be entering quantities of fabric being
used and these quantities are decimals. But it just keeps rounding. I don't
know why and I have to fix it because it becomes part of a pricing equation.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13113-decimals-rounding-without-wanting-them-too.html
Please Help.
Thanks in Advance.
Travis

*








 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:34 AM
fredg's Avatar fredg
Guest
 
Posts: n/a
   
   
Re: Decimals rounding without wanting them too.

On Wed, 12 Jul 2006 12:18:01 -0700, Tdahlman wrote:

> I have a table and I'm supposed to be entering quantities of fabric being
> used and these quantities are decimals. But it just keeps rounding. I don't
> know why and I have to fix it because it becomes part of a pricing equation.
> Please Help.
> Thanks in Advance.
> Travis

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113

Usually it's because the field's datatype has incorrectly been set to
Number, Integer Field Size.
An Integer, by definition is a whole number and cannot have a decimal
part.
Change the Field size property to single or double.
--
Fred
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
Please respond only to this newsgroup.
I do not reply to personal e-mail
Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:34 AM
Albert D.Kallal's Avatar Albert D.Kallal
Guest
 
Posts: n/a
   
   
Re: Decimals rounding without wanting them too.

Welcome to computers, and decimal math!!!

Take the following code in ms-access

Public Sub TestAdd()


Dim MyNumber As Single
Dim i As Integer


For i = 1 To 10
MyNumber = MyNumber + 1.01
Debug.Print MyNumber
Next i
End Sub


Here is the actual output of the above:


1.01
2.02
3.03
4.04
5.05
6.06
7.070001
8.080001
9.090001
10.1


You can see that after just 7 additions..already rounding is occurring

and if we add the following line of code to the end of the above:

if MyNumber = 10.1 = True then
msgbox "the number is 10.1"
else
msgbox "the number is somthing else"
endif


The above will actual produce:

the number is something else

What the above means that decimal numbers represented in a computer are only
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
a approximation. The solution is to user integer numbers, or in the case of
financial calculations, use currency data type. (the currency data type is a
actually a scaled integer,a nd it fakes the decimal repression by
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
representation integer..and moving the decimal point).

Try changing your data types to currency, and that should cure your rounding
problems...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal


Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:34 AM
Jamie Collins's Avatar Jamie Collins
Guest
 
Posts: n/a
   
   
Re: Decimals rounding without wanting them too.


Albert D.Kallal wrote:
> Try changing your data types to currency, and that should cure your rounding
> problems...


Or indeed to the DECIMAL data type e.g. the OP hasn't specified but the
values involved may have more than four decimal places.

Personally, I'd find it confusing to encounter a schema that modelled
fabric quantities as CURRENCY.

Changing the data type to currency may introduce other more subtle
rounding issues. The CURRENCY type rounds values using a banker's
rounding algorithm, which may not be appropriate to fabric quantities.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
The DECIMAL type truncates and therefore may be the way to go if the
aim truly is to eliminate rounding.

Jamie.

--

Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:34 AM
Albert D.Kallal's Avatar Albert D.Kallal
Guest
 
Posts: n/a
   
   
Re: Decimals rounding without wanting them too.

I had a rather large, and perhaps heated debate/exchange on this issue
recently...

I come around a bit on this issue. So, I do now accept that using decimal
type is a reasonable choice here.....

> the OP hasn't specified but the
> values involved may have more than four decimal places.

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113

Yes, the above is likely the deal breaker issue here. (my guess is .25, .5.
75 etc...but, we really don't know the lengths involved)

>
> Personally, I'd find it confusing to encounter a schema that modelled
> fabric quantities as CURRENCY.


That is another fair point. However, support in ms-access is better for
currency data types.

There are pros/cons, and not knowing if any rounding is needed makes this
decision a toss up right now......

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113


Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:35 AM
Jamie Collins's Avatar Jamie Collins
Guest
 
Posts: n/a
   
   
Re: Decimals rounding without wanting them too.

  Donate Today!  

Albert D.Kallal wrote:
> I come around a bit on this issue. So, I do now accept that using decimal
> type is a reasonable choice here.....
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13113
>
> support in ms-access is better for
> currency
>
> There are pros/cons, and not knowing if any rounding is needed makes this
> decision a toss up right now......


In the same spirit, I thank you for presenting a balanced view.

Jamie.

--

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 335 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,038 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 81 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 116 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 229 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 44 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 414 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 09:20 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.36421 seconds with 30 queries