From: Nick Burch Date: Thu, 16 Oct 2014 21:41:11 +0000 (+0000) Subject: Add a note on how this is not the right way to make a string of your cell X-Git-Tag: REL_3_11_BETA3~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aa6ea5344b7bdcbf90f54b3d0dd3f2ce76dcc72d;p=poi.git Add a note on how this is not the right way to make a string of your cell git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1632438 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/ss/usermodel/Cell.java b/src/java/org/apache/poi/ss/usermodel/Cell.java index 0a3f668cf4..528fa2730c 100644 --- a/src/java/org/apache/poi/ss/usermodel/Cell.java +++ b/src/java/org/apache/poi/ss/usermodel/Cell.java @@ -110,8 +110,13 @@ public interface Cell { /** * Set the cells type (numeric, formula or string). - * If the cell currently contains a value, the value will - * be converted to match the new type, if possible. + *

If the cell currently contains a value, the value will + * be converted to match the new type, if possible. Formatting + * is generally lost in the process however.

+ *

If what you want to do is get a String value for your + * numeric cell, stop!. This is not the way to do it. + * Instead, for fetching the string value of a numeric or boolean + * or date cell, use {@link DataFormatter} instead.

* * @throws IllegalArgumentException if the specified cell type is invalid * @throws IllegalStateException if the current value cannot be converted to the new type