ro/cf: strip RO country prefix in compact() for consistent output#499
Open
gaoflow wants to merge 1 commit into
Open
ro/cf: strip RO country prefix in compact() for consistent output#499gaoflow wants to merge 1 commit into
gaoflow wants to merge 1 commit into
Conversation
validate('RO 185 472 90') previously returned 'RO18547290' while
validate('185 472 90') returned '18547290' for the same number,
making the output format depend on the input form. compact() now
strips the optional RO VAT prefix so validate() always returns the
domestic CUI/CIF digits, consistent with cui.compact() and the
behaviour of other country modules such as pl/nip.
Closes arthurdejong#485.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #485.
stdnum.ro.cfproduced inconsistent output depending on whether the optionalROcountry prefix was present in the input:Both inputs denote the same number, but
compact()did not strip theROprefix the way thecui.compact()it delegates to (and other country modules such aspl/nip) do.Fix
compact()now strips theROprefix, returning the domestic form — matchingcui.compact()and sibling modules.validate()is simplified: the manualROsplit is removed sincecompact()now handles it.'18547290'.validate('RO 185 472 90')andvalidate('185 472 90')now both return'18547290'.This pull request was prepared with the assistance of AI, under my direction and review.