I am setting some properties on a few nodes. Here is the query I am attempting to execute.
match (i:Invoice {InvoiceNr:"1456735/2553"})
MERGE (i)-[:SUB_INVOICE]->(si:Invoice{InvoiceNr:"102435433/231",Total:197,30})
RETURN i,si
How do I get the value with the comma to ne escaped. I did a search in the manual for escape characters, but just got stuff on loading CSV data and regular expressions.
I tried to add it to the property and Cypher thinks that everthing after the comma is a new property. So I get an error saying it is expecting a key value pair in essence. So Total: 197 and then OtherPrice: 30
So that is why I thought maybe escaping it would allow cypher to understand what I am trying to do.
Hi - are you expecting this?
match (i:Invoice {InvoiceNr:"1456735/2553"})
MERGE (i)-[:SUB_INVOICE]->(si:Invoice{InvoiceNr:"102435433/231",Total:"197,30"})
RETURN i,si
or
match (i:Invoice {InvoiceNr:"1456735/2553"})
MERGE (i)-[:SUB_INVOICE]->(si:Invoice{InvoiceNr:"102435433/231",Total:'197,30'})
RETURN i,si
I don't believe that Neo4j has a configurable decimal separator, it recognises only .
Storing your values as strings is probably your best bet, and then if you need to perform calculations on them you can convert using toFloat on the fly e.g:
with "6,10" as firstVal, "5,10" as secondVal
return toFloat(replace(firstVal, ",", ".")) - toFloat(replace(secondVal, ",", "."))
I think you're getting caught up on the visual display of the data vs. how it needs to be stored in a database. Store it as an int 19730, and let the website/UI handle the formatting of the data. Computers don't care about local formatting. Another example of this would be a date. Different regions display dates differently but you still store the information as a date data type and handle the display formatting in the UI.