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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:23:27+00:00 2026-05-19T22:23:27+00:00

I have a unique problem. I have a database with lot of tables and

  • 0

I have a unique problem. I have a database with lot of tables and I am trying to do some comparison of each table with a file. now in certain cases my db contains double/float columns and they might exceed a certain no of decimal places than that of the same column in the file. Say for convenience sake we pick this no to be 4 decimal places.

Now I want to convert all float/double columns returned by my db to a string of 4 decimal places if its more than that.how can i achieve the same. Please note that each of ther table might contain in excesss of 2000 rows and I dont want to make this comparison heavy. Any idea how I can achieve the same?

Thanks in advance

Based on some answers and comments:

a) RDBMS: MS SQl server

b)I want the decimal places to only be cut short if it exceeds a certain no. i.e if the no is 12.123 it should stat 12.123 and nt 12.1230

I realise I can get this done by using # but # just prints the no it doesnt round off the no i.e if the no is 12.12347 it should round off 12.1235

  • 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-19T22:23:27+00:00Added an answer on May 19, 2026 at 10:23 pm

    Something like this for float limitation to a number of decimal places:

    string stFloat = String.Format("{0:0.0000}", FLOAT_VALUE);
    

    Apply this to the data that is received from the DB.

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

Sidebar

Related Questions

I have an SQL database with a set of tables that have Unique Id's.
i'm having a problem with my database. I have the folowing: create table book
I have a bit of a unique problem with an upcoming project; I need
I have a bit of a unique problem. I am registering a dll as
I know that using the following codes will make each column have unique values,
I've got an app with three spinners, they have unique IDs and I'm trying
I have a unique set-up I am trying to determine if Heroku can accommodate.
I have a slightly unique requirement with the Java-JDBC API along with Oracle Database.
I have a table in my database which has duplicate records that I want
I have my database segmented in 8 parts, where each part contains database with

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.