Re: BigDecimal values

2008-11-22 Thread Yonik Seeley
On Thu, Nov 20, 2008 at 9:30 AM, Sergey Kabashnyuk <[EMAIL PROTECTED]> wrote: > Thanks Ian > > Unfortunately, I have to index any possible number of java.math.BigDecimal > I can rephrase my question this way: > > How can I convert java.math.BigDecimal numbers in to string > for its storing in lexic

Re: BigDecimal values

2008-11-21 Thread Michael Ludwig
Michael Ludwig schrieb: I assume what you mean is formatting the number so that the lexicographical order of any possible sequence of acceptable numbers is the same as its numerical order. You must find a canonical representation like the scientific notation and then tweak it as follows: * "N"

RE: BigDecimal values

2008-11-20 Thread Steven A Rowe
Hi Sergey, On 11/20/2008 at 9:30 AM, Sergey Kabashnyuk wrote: > How can I convert java.math.BigDecimal numbers in to string > for its storing in lexicographical order Here's a thoroughly untested idea, cribbing some from o.a.l.document.NumberTools[1]: convert BigDecimals into strings of the fol

Re: BigDecimal values

2008-11-20 Thread Michael Ludwig
Sergey Kabashnyuk schrieb: Unfortunately, I have to index any possible number of java.math.BigDecimal Hi Sergey, quite a lot of numbers are possible for BigDecimal. Somehow the range must be bounded. Let's first draw the line where, for a given BigDecimal bd, the result of bd.toString(), whic

Re: BigDecimal values

2008-11-20 Thread Sergey Kabashnyuk
Thanks Ian Unfortunately, I have to index any possible number of java.math.BigDecimal I can rephrase my question this way: How can I convert java.math.BigDecimal numbers in to string for its storing in lexicographical order Sergey Kabashnyuk eXo Platform SAS Hi Lucene only indexes strings.

Re: BigDecimal values

2008-11-20 Thread Ian Lea
Hi Lucene only indexes strings. The standard advice for numeric is to pad to desired width with leading zeros, if likely to be used in range searches. How varied are the numbers you're going to be working with? I only work with stuff with 2 decimal places and tend to lose that. e.g. 2.22 woul