Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

float or decimal 1

Status
Not open for further replies.

Gooser

Technical User
Joined
Jun 28, 2006
Messages
803
Location
US

I need to store a [tt]factor[/tt] which will be multiplied by numbers that will be around the $XX,000,000 range to get a fee based on volume of sales. The factors are very small decimal values between .000025 and .001 which I am currently storing as floats. Is this the right data type? Should I use decimals?

How do I get Query analyzer to return something prettier than [tt]7.7999999999999999E-4[/tt]?

Thanks,
 
Float (and Real) are approximate data types. I suggest you change this field to decimal instead.

Looking at the smallest number (.000025) and the largest number (0.001), I recommend...

Decimal(6,6)

The first number represents the total number of digits that can be stored. The second number represents the number of digits AFTER the decimal point.

so.... 12.3456 would require Decimal(6,4).

Make sense?

-George

"the screen with the little boxes in the window." - Moron
 

George--

You RULE.

Thanks,
--Gooser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top