Jonathan- right in one! Using floats for prices will lead to madness. My mortgage UI kept changing the loan's interest rate.
On Fri, Feb 4, 2011 at 12:13 PM, Dennis Gearon <gear...@sbcglobal.net> wrote: > That's a good idea, Yonik. So, fields that aren't stored don't get displayed, > so > the float field in the schema never gets seen by the user. Good, I like it. > > Dennis Gearon > > > Signature Warning > ---------------- > It is always a good idea to learn from your own mistakes. It is usually a > better > idea to learn from others’ mistakes, so you do not have to make them yourself. > from 'http://blogs.techrepublic.com.com/security/?p=4501&tag=nl.e036' > > > EARTH has a Right To Life, > otherwise we all die. > > > > ----- Original Message ---- > From: Yonik Seeley <yo...@lucidimagination.com> > To: solr-user@lucene.apache.org > Sent: Fri, February 4, 2011 10:49:42 AM > Subject: Re: prices > > On Fri, Feb 4, 2011 at 12:56 PM, Dennis Gearon <gear...@sbcglobal.net> wrote: >> Using solr 1.4. >> >> I have a price in my schema. Currently it's a tfloat. Somewhere along the way >> from php, json, solr, and back, extra zeroes are getting truncated along with >> the decimal point for even dollar amounts. >> >> So I have two questions, neither of which seemed to be findable with google. >> >> A/ Any way to keep both zeroes going inito a float field? (In the analyzer, >>with >> XML output, the values are shown with 1 zero) >> B/ Can strings be used in range queries like a float and work well for >> prices? > > You could do a copyField into a stored string field and use the tfloat > (or tint and store cents) > for range queries, searching, etc, and the string field just for display. > > -Yonik > http://lucidimagination.com > > > > >> >> Dennis Gearon >> >> >> Signature Warning >> ---------------- >> It is always a good idea to learn from your own mistakes. It is usually a >>better >> idea to learn from others’ mistakes, so you do not have to make them >> yourself. >> from 'http://blogs.techrepublic.com.com/security/?p=4501&tag=nl.e036' >> >> >> EARTH has a Right To Life, >> otherwise we all die. >> >> > > -- Lance Norskog goks...@gmail.com