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

Pause with decimal numbers, thousand separators etc. #122

Closed
rsbondi opened this issue Mar 21, 2014 · 2 comments
Closed

Pause with decimal numbers, thousand separators etc. #122

rsbondi opened this issue Mar 21, 2014 · 2 comments

Comments

@rsbondi
Copy link

rsbondi commented Mar 21, 2014

26.2 is read [26. - pause - 2], it would be better imo to preserve it as a word. Same with 1,000,000 as a single word with no pause.

the following appears to give the pauses

.replace(/[\,\.\!\:\;](?![\"\'\)\]\}])/g, "$& ") 

I am not sure I understand the intention of the lookahead but

.replace(/[\,\.\!\:\;](?![\"\'\)\]\}])[\s\n]/g, "$& ") 

would only pause when followed by whitespace or newline, which better represents a pause point.

@dsernst
Copy link

dsernst commented Mar 26, 2014

I agree with your premise: it would improve readability to preserve numbers with comma or decimal separators.

It seems the lookahead is intended to condition against inserting a pause when the punctuation is followed by ", ', ), ], or }, such as at the end of a quotation or parenthetical phrase.

And \n may be redundant in that character class, because \s includes  , \t, \r, and \n.

@dsernst
Copy link

dsernst commented Mar 26, 2014

And perhaps #43 would fix this. 😃

@rsbondi rsbondi closed this as completed Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants