Thanks Richard.
Save as string is no problem, but I want to compare the value in JCR query as
double or decimal, and CAST function only works on right hand, so if it's saved
as string, how I can compare it with other double? Right now my query is:
select * from [mgnl:myType] where myDoubeProperty > CAST('100.0' as Double)
and it works. if I save it as string, then expect query will be like:
select * from [mgnl:myType] where CAST(myDoubeProperty as Double) >
CAST('100.0' as Double)
But it doesn't work. Any suggestion?
Gray
[quote]Hi Gray-
I think that's a side effect of using Double. You get a precision of 3. It
might be possible to adjust it globally. I'm not sure though.
If I were you, then I'd just use String to store the value. Then you will not
have the issue of truncation. Whenever you need to use the value later, in
code, just convert it to Double there.
Or you could also have a lot the Decimal type. See
https://docs.adobe.com/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/PropertyType.html#DECIMAL.
Never tried that myself.
HTH
richg[/quote]
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=fb6148c5-9687-45db-9f07-8570c9a8c364
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------