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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:16:09+00:00 2026-05-23T00:16:09+00:00

I am using Apache POI-HSSF for working with Excel files. I have a cell

  • 0

I am using Apache POI-HSSF for working with Excel files.

I have a cell in my spreadsheet that looks like “115”. I verified that it is formatted as “Text” (Format Cells -> Text).

However, when I read it in as
row.getCell(0).toString()

I get this string: “115.0”

This is incorrect. I should be getting “115” since it’s explicitly formatted as Text. How can I get the desired result? The cell can be anything, numbers or characters, and I expect the same string as in the cell. 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-05-23T00:16:10+00:00Added an answer on May 23, 2026 at 12:16 am

    Formatted as text does not mean stored as text, they’re different. Excel has stored your cell as a number, and when you ask POI for the cell you get a numeric cell back.

    If you ask the cell you get back what type it is, you’ll discover it’s of type CELL_TYPE_NUMERIC and not CELL_TYPE_STRING

    What you’ll likely want to do is use the DataFormatter class to have your cell formatted as per Excel. It’ll then look like you expect. (As will cells formatted as currency, percentages etc too)

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

Sidebar

Related Questions

In Java, we're using the following package to programmatically create excel documents: org.apache.poi.hssf If
I am using Apache Poi and Java for Excel manipulation. I have modified some
Using Apache POI HSSF, we can create xls file like this private void write(HSSFWorkbook
I want to read all cell value from excel sheet using Apache POI and
I need to display the newly generated excel (from tables using Apache POI) in
I am using the following the following class org.apache.poi.hssf.usermodel.HSSFCell , with a list of
Whilst trying to parse MS Excel file using POI-HSSF v3.2 I am getting IndexOutOfBoundsException.
I am using Apache POI to store data in excel sheet. I can store
I am using Apache HttpClient and would like to communicate HTTP errors (400 Bad
I am using apache ant to generate javadoc for my project. I have a

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.