473,781 Members | 2,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access currency and decimals

22 New Member
Hi all,

Im having trouble with currency formatting and the amount of decimals displayed. Most of my stored values are pretty standard ($10.50). Some item have a 4 decimal place cost though ($.0025). I have the table formatted to store 4 decimal places but when using the currency format it drops the last two places of the value. Is there a way around this or do i have to use general number format for the table? I also dont want the field to display 4 digits after the decimal if its not necessary. ($50.00 instead of $50.0000)
May 30 '06 #1
2 3653
PEB
1,418 Recognized Expert Top Contributor
Hi,

As format of your digits you should choose General with 2 decimal places... But when there is .00 the .00 not be shown also!

There is functions to do truncation

For exemple you can use the follow:

Int(My_number*1 00+0.5)/100

So if your nember is 105.002
then 10500.2+0.5=105 00.7
after int it gives 10500 then / 100 = 105.00 :)
Sep 3 '06 #2
comteck
179 New Member
There's something I'm not understanding here. Why do you have your table set up to display 4 decimal places, when you only want 2 for your currency?

comteck
Sep 5 '06 #3

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

Similar topics

4
9425
by: digitalavatar | last post by:
I am having a problem with my Access 2000 front end to a SQL 7 or 2000 database. I create a table in SQL with a field named, say, amt, data type MONEY. When I link the table in Access using ODBC, the field is defined as CURRENCY, as expected. Now, if I use SQL to populate the field with a 3- or 4-decimal amount like 1.234, it appears in the Access table as 1.23 only. If I expand the decimals to 3 places it will be 1.230; if the...
6
9554
by: Mitchell Vincent | last post by:
Just making sure I'm not missing the boat here, but are there any special routines for doing currency math (fixed precision stuff) in .NET? The wonderful problems of doing math on decimals tend to shine when writing accounting software :-) How are others dealing with this? -- - Mitchell Vincent
1
2716
by: D. Shane Fowlkes | last post by:
Quick question - I have output from a Money MS SQL field going into a repeater's dataitem. The db does not store any cents (decimals). How can I get this on the page: <%#DataBinder.Eval(Container.DataItem, "Revenue", "{0:C}")%> ...NOT to display any decimals or cents?
2
1586
by: crferguson | last post by:
Hello all! I'm having the oddest issue trying to format a numeric string as currency without decimals. For instance... strSalary = "120000.56" strSalary = Format(strSalary, "$#,##0") 'this one returns "$#,##0" literally, no number strSalary = Format(strSalary, "C0") 'this one returns "C0" literally, no number
1
2090
by: pebelund | last post by:
Hi I got an .aspx that got the following code (example) <td width="120"> <% = row %> </td> row takes a value from a SQL db, that is a string of numbers. On the webbsite I want this to show as value formatted in thousands (example: I get the value 12345678, and I want it to show like 12 345
1
1806
by: roger2282 | last post by:
help, I am trying to update a field on my database and cant seem to get the right value stored eg on reading the database field i get the values I need such as 31.24, 3.15 and 16.00 and I use these in the web application successfully but when I come to write these values back to the database I cant write the decimals. when I write these values back using the code RecordSet("price") = intprice I get 16.00 and 3124.00...
3
3107
by: Jx4 | last post by:
Hi there, I am currently having trouble with some issues with adding Currency values. I have one column with values of transactions and the other column has a running total. It works great however, because the numbers are rounded (currency), they don't look like they add up right eventhough they do. For instance: if you add $2,632.1743 and $8.6528, you get $2,640.8271. The problem is when the currency rounds these amounts you get:...
1
2121
by: Warren Thai | last post by:
I am using Access 2003. I need to export data from a query to a .txt file. I know how to do this but however there is a problem with my data being rounded. The numbers in the data have 3 decimal places but when I export the data, the numbers in the text file are rounded to 2 decimal places. How do I stop this rounding? Warren
1
7494
by: =?Utf-8?B?eXVyaWtz?= | last post by:
Hey, I'm building a business application that needs input of currency data. I looked a lot around google and friends for a good custom control to provide interactive validation and formatting of the value. What I need would be a WinForms textbox control that: - Correctly formats the number according to locales - Supports negative values - Displays thousands separators correctly
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10308
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.