Number format when fetching data out of Neo4j

34 views
Skip to first unread message

Newbie

unread,
Mar 30, 2012, 3:26:44 PM3/30/12
to Neo4j
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

Peter Neubauer

unread,
Mar 31, 2012, 5:32:30 AM3/31/12
to ne...@googlegroups.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

Michael Hunger

unread,
Mar 31, 2012, 6:59:06 AM3/31/12
to ne...@googlegroups.com
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

Newbie

unread,
Apr 5, 2012, 4:14:14 PM4/5/12
to Neo4j
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
>

Michael Hunger

unread,
Apr 5, 2012, 4:49:00 PM4/5/12
to ne...@googlegroups.com
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

Reply all
Reply to author
Forward
0 new messages