Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 570461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:24:14+00:00 2026-05-13T13:24:14+00:00

In a previous project, I noticed that the price field was being stored as

  • 0

In a previous project, I noticed that the price field was being stored as an int, rather than as a float. This is done by multiplying the actual value by 100, the reason being was to avoid running into floating point problems.

Is this a good practice that I should follow or is it unnecessary and only makes the data less transparent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:24:14+00:00Added an answer on May 13, 2026 at 1:24 pm

    Interesting question.

    I wouldn’t actually choose float in the mysql environment. Too many problems in the past with precision with that datatype.

    To me, the choice would be between int and decimal(18,4).

    I’ve seen real world examples integers used to represent floating point values. The internals of JD Edwards datatables all do this. Quantities are typically divided by 10000. While I’m sure it’s faster and smaller in-table, it just means that we’re always having to CAST the ints to a decimal value if we want to do anything with them, especially division.

    From a programming perspective, I’d always prefer to work with decimal for price ( or money in RDBMSs that support it ).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently noticed that some of my commits from my current project were being
I've created a new Netbeans project and noticed that unlike my previous project it's
I am taking over an existing PHP project. I noticed that the previous developer
In C# our maintainance project, we observered that the previous company has a root
I have this jQuery code from my previous project and I want to modify
In a previous project, I built an iPhone app for 2.2.x that used SQLite.
--- Note to moderators: Today (July 15), I've noticed that someone already faced this
So I have this Access Database Project file that I have been tasked to
I was planning on starting a project using Turbogears 2. I noticed however that
How embarrassing. I had this working on a previous project, but now i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.