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 8156525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:58:49+00:00 2026-06-06T16:58:49+00:00

Bit of an unusual question, but I have setup a field inside a MySQL

  • 0

Bit of an unusual question, but I have setup a field inside a MySQL table that is of the datatype “DECIMAL(5,2)”. As far as I understand this, what I have done is to only allow numbers from -999.99 up to 999.99 to be inserted into this field.

However, when I insert an integer to the value of 26 (which is valid) I am shown this inside the database as 26 not 26.00 – is this normal MySQL behaviour? I (perhaps naively) thought that because I have set the scale to 2, my numbers would always be shown with 2 decimal places?

My question is – do integers inside MySQL “DECIMAL” datatypes always display without any decimals places? Or is this my database manager tool formatting 26.00 to 26 for me?

This may seem like a bit of a weird question but I am still trying to get my head around MySQL DECIMALs. Thanks.

  • 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-06-06T16:58:51+00:00Added an answer on June 6, 2026 at 4:58 pm

    I have found the answer out, it seems my MySQL database manager is helpfully (or not so helpfully) hiding the decimals from me. For anyone who finds this vaguely useful I am using EMS SQL Manager 2010 on Windows 7. Credit due to Cylindric who prompted me to check my tools!

    In answer to my original question – yes, even integers inside a “DECIMAL” datatype will display the decimal places. For example:

    DECIMAL(3,1)
    
    42 = 42.0
    531.2 = 99.9
    5 = 5.0
    

    Hope this helps someone somewhere!

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

Sidebar

Related Questions

This is a bit of an unusual question but I have a test case
Bit support question. Apologies for that. I have an application linked with GNU readline.
So we have a bit of an unusual setup in our software. On a
I have a bit of an unusual setup. I just have the compilers installed,
This is a bit of unusual problem that I'm experiencing, but recently one of
it is a bit unusual question but I am unable to get casting error
I have a bit of an unusual question. I'm running an old DOS game
Bit of a strange question here i know. but i wanted to know if
Bit of a philosophical question. If you have a public website with a site
Bit of an odd question but is there a way of seeing what objects

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.