Google Groups

Re: [Neo4j] Re: Number format when fetching data out of Neo4j


Michael Hunger Apr 5, 2012 1:49 PM
Posted in group: Neo4j
So if you print the r == Buy then it is formatted as a scientific value?

Perhaps just use a suitable to-string method that formats it in the way you need?

Can you check the actual double number with the debugger to see if its precision is off?

Michael

Am 05.04.2012 um 22:14 schrieb Newbie:

> This is my query looks like:
>
> @Query("start p=node:Person(0) match p-[r:Buy]->items return r order
> by r.volume desc")
> public List<Buy> findRatings();
>
> volume is defined as double in the @RelationshipEntity Buy object.
> When I use webadmin to check the data, r.volume shows the exact format
> that I would expect; but when fetch with this method, r.volume is in
> scientific format. I checked the value in the return object before any
> JSON operations were performed by me.
>
> I am using embedded db.
>
> Thanks,
>
>
> On Mar 31, 6:59 am, Michael Hunger <michael.hun...@neopersistence.com>
> wrote:
>> Rather a double or float. Might be an issue of json parsing? As I assume you run against the server.
>>
>> How do you fetch the raw number with the graphrepository?
>>
>> Sent from mobile device
>>
>> Am 31.03.2012 um 11:32 schrieb Peter Neubauer <peter.neuba...@neotechnology.com>:
>>
>>
>>
>>
>>
>>
>>
>>> So,
>>> you are getting a LONG back? Got any minimal testcase showing this?
>>
>>> Cheers,
>>
>>> /peter neubauer
>>
>>> G:  neubauer.peter
>>> S:  peter.neubauer
>>> P:  +46 704 106975
>>> L:  http://www.linkedin.com/in/neubauer
>>> T:   @peterneubauer
>>
>>> Neo4j                                - Graphs rule.
>>> Program or be programmed - Computer Literacy for kids.
>>> http://foocafe.org/#CoderDojo
>>
>>> On Fri, Mar 30, 2012 at 9:26 PM, Newbie <xia.inter...@gmail.com> wrote:
>>>> I have a value of 55890000 stored in Neo4j and I can see the number in
>>>> the exact form while using webadmin. When I fetch it out via
>>>> GraphRepository, the number becomes 5.589E7, which is the same number
>>>> but in scientific format. Is there a way not to do this conversion?
>>
>>>> My field type is "long" in my NodeEntity mapping object. I use spring-
>>>> data to annotate my POJO.
>>
>>>> Thanks,
>>>> Daniel