Bug 53397 - Add support for dates in function TEXT(value, format_text)
Summary: Add support for dates in function TEXT(value, format_text)
Status: RESOLVED LATER
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 16:13 UTC by Peter Taylor
Modified: 2015-06-01 21:09 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Taylor 2012-06-11 16:13:40 UTC
In Excel I can create a formula:
=TEXT("12:13:14","hh:mm:ss")

This evaluates to the time 12:13:14

The limitation is imposed by
org.apache.poi.ss.formula.functions.TextFunction#TEXT

which assumes the 1st argument is a double (immediately).
Comment 2 Nick Burch 2012-06-12 22:00:16 UTC
Any chance you could work up a patch to improve this? I guess you'll need to extend the function to check for alternate types of argument, and parse them to a double appropriately before formatting.
Comment 3 Peter Taylor 2012-06-13 08:59:27 UTC
I shall attempt to do so. But it will not be immediately.
Comment 4 Dominik Stadler 2015-06-01 21:09:21 UTC
Changing status on this one for now as "not immediately" seems to have become at some later pointer.