Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseFloat(), parseInt(), format() seems to ignore locale parameter #76

Closed
neo-technology-build-agent opened this issue Sep 1, 2022 · 2 comments
Labels

Comments

@neo-technology-build-agent
Copy link
Collaborator

Issue by malencv
Monday Nov 23, 2020 at 14:36 GMT
Originally opened as neo4j-contrib/neo4j-apoc-procedures#1725


Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.

Expected Behavior (Mandatory)

According to the docs (
RETURN apoc.number.parseFloat('12.345,67', '#,##0.00;(#,##0.00)', 'it') as value;

12345.67

That works for me in 3.5.6

Also:

RETURN apoc.number.parseInt('12.345', '#,##0.00;(#,##0.00)', 'it') as value;
should return: 12345

and

RETURN apoc.number.format(12345.67, '#,##0.00;(#,##0.00)', 'it') as value;
should return 12.345,67

Actual Behavior (Mandatory)

In 4.2.0 (and 4.1.0):

RETURN apoc.number.parseFloat('12.345,67', '#,##0.00;(#,##0.00)', 'it') as value;
12.345

(only tried in 4.2.0)
RETURN apoc.number.parseInt('12.345', '#,##0.00;(#,##0.00)', 'it') as value;
12,345.67

(only tried in 4.2.0)
RETURN apoc.number.format(12345.67, '#,##0.00;(#,##0.00)', 'it') as value;
12,345.67

How to Reproduce the Problem

See call above

Simple Dataset (where it's possibile)

Not needed.

//Insert here a set of Cypher statements that helps us to reproduce the problem
RETURN apoc.number.parseFloat('12.345,67', '#,##0.00;(#,##0.00)', 'it') as value;

Steps (Mandatory)

  1. Run RETURN apoc.number.parseFloat('12.345,67', '#,##0.00;(#,##0.00)', 'it') as value;
  2. Verify that the result does not match with the docs example

Screenshots (where it's possibile)

Specifications (Mandatory)

Currently used versions

Versions

  • OS: MAcOS Catalina 10.15.7 (19H2)
  • Neo4j: 4.2.0
  • Neo4j-Apoc: apoc-4.2.0-rc02-core.jar

And

  • OS: MAcOS Catalina 10.15.7 (19H2)
  • Neo4j: 4.1.0
  • Neo4j-Apoc: apoc-4.1.0.1.jar
@neo-technology-build-agent
Copy link
Collaborator Author

Comment by vga91
Monday Feb 01, 2021 at 17:52 GMT


@malencv I didn't reproduce the problem, in both versions.
Could you try again with the latest versions? Thank you.

@JoelBergstrand
Copy link
Contributor

Works as expected on latest 4.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants