473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

money data type

I choose a price field as a money data type, but I cannot change the
scale of this.
the default scale is 4 (it dimmed).
how can I change to 2? I only need 2 scale such as $23.33 instead of
$23.3344

Jun 1 '06 #1
3 11466
If you want the scale to be 2, instead of using MONEY you might want to
consider using DECIMAL or NUMERIC datatype with the required precision &
scale.

--
Anith
Jun 1 '06 #2
HandersonVA wrote:
I choose a price field as a money data type, but I cannot change the
scale of this.
the default scale is 4 (it dimmed).
how can I change to 2? I only need 2 scale such as $23.33 instead of
$23.3344


Use the DECIMAL(<precision>,<scale>) instead of the MONEY data type. E.g.:

sales_price DECIMAL(9,2)

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Jun 2 '06 #3
SQL
Also the money data type is not a good candidate since there are some
rounding issues with it. Numeric/decimal is the way to go
Denis the SQL Menace
http://sqlservercode.blogspot.com/

HandersonVA wrote:
I choose a price field as a money data type, but I cannot change the
scale of this.
the default scale is 4 (it dimmed).
how can I change to 2? I only need 2 scale such as $23.33 instead of
$23.3344


Jun 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Batista, Facundo | last post by:
Can't find it. I mean something like: >> m1 = Money(decimal=2) >> m2 = Money(decimal=2) >> m1.value = 3.20 >> m2.value = 2.15 >> print m1 + m2 5.35
24
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing the code. Thank you. .. Facundo
1
by: Jason Szotak | last post by:
Recently we upgraded the .Net Framework to v1.1. All of a sudden all of our queries run through .Net pages began showing all 4 of the decimal places for the money data type. Queries run through asp...
12
by: David Garamond | last post by:
What do people recommend for storing money amounts? I've seen people use NUMERIC(18,3) and other use NUMERIC(18,4). Which one is more appropriate and why? This is considering various existing...
0
by: Sam | last post by:
I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data type of 'Money...
0
by: Sam | last post by:
Folks.. I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data...
3
by: Stephan Diehl | last post by:
Hi lazyweb, I'm wondering, if there is a usable money data type for python available. A quick search in pypi and google didn't convey anything, even though the decimal data type seemed to be...
2
by: thesti | last post by:
hi, i want to ask about money datatype, what makes it special or different that we better use it for a currency related field (like the price of a product) instead of using just, say a bigint or a...
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
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,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
1
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.