Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Strip out any number of trailing zeros after the decimal point ".0+" #670

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

albarrentine
Copy link
Contributor

For the new Belarus data set in openaddresses/openaddresses#3409, it would be useful for machine to strip multiple trailing zeros rather than only the single ".0" from the end of a float.

This PR will strip out the following pattern: (?<=[0-9])\.0+(?![0-9]). Applies to join and format on any field and is used for row_canonicalize_unit_and_number.

The above regex will strip the .0+ in these cases:

  • 12.0
  • 12.0A
  • 12.000000
  • 12.000000A

But not in these cases:

  • 12.01
  • A.0

Added tests for the new functionality.

@albarrentine
Copy link
Contributor Author

And again no running build, same deal as #656.

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

Successfully merging this pull request may close these issues.

1 participant