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

  • Home
  • SEARCH
  • 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 6122223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:52:25+00:00 2026-05-23T15:52:25+00:00

I am working on a tool which generated a few thousand ASCII files (constraints),

  • 0

I am working on a tool which generated a few thousand ASCII files (constraints), the contents of which include floating point numbers. I would like to run these constraints for comparison through an similar tool, which cannot handle floating point values with more than 20 decimal places. Testing manually indicates that simple truncation will suffice. So, how can I truncate all floating point values in a file (which are uniquely marked by a period) to no more than 20 decimal places?

Thanks,

Jon

  • 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-23T15:52:26+00:00Added an answer on May 23, 2026 at 3:52 pm

    I know for sure in Java and C (and almost certainly in other languages) there are ways to format strings. String.format() and printf() are some good examples. These can be used for case by doing something like:

    printf("%.20f", myFloat); 
    

    I’ll find a website with better instructions in a second.

    edit:

    this should probably be a good enough link to get an idea:

    http://www.cplusplus.com/reference/clibrary/cstdio/printf/

    edit:

    if you would like to use sed, a quick search makes it seem as though sed has a printf function too. the example I found is here:

    http://docstore.mik.ua/orelly/unix/sedawk/ch07_09.htm

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

Sidebar

Related Questions

I am currently working on some LaTeX document which embeds C# files generated by
I am working on a command-line tool which would run the method - [NSMutableDictionary
I have searched and am looking for a tool which would help when working
I am working on a tool which is built using jdk 1.5u22. But, I
Currently I am working on signing a 64-bit driver for a USB tool which
I am working on tool to optimize linq to sql queries. Basically it intercepts
I am working on a tool that monitors a number of applications and ensures
I'm very interesting in inexpensive (better free) SQL query tool for working with multiple
I am working on database migration tool in java. The tool is copying database
I am working on a transliteration tool. I have two modules lexer and translator.

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.