Skip to content

Commit 693ebd7

Browse files
Update src/lib/index.js
Co-authored-by: Alex Johnson <[email protected]>
1 parent bdb69fc commit 693ebd7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ var lib = module.exports = {};
1515
lib.adjustFormat = function adjustFormat(formatStr) {
1616
if(
1717
!formatStr ||
18-
/^[0123456789].[0123456789]f/.test(formatStr) ||
19-
/.[0123456789]%/.test(formatStr)
18+
/^\d[.]\df/.test(formatStr) ||
19+
/[.]\d%/.test(formatStr)
2020
) return formatStr;
2121

2222
if(formatStr === '0.f') return '~f';
23-
if(/^[0123456789]%/.test(formatStr)) return '~%';
24-
if(/^[0123456789]s/.test(formatStr)) return '~s';
23+
if(/^\d%/.test(formatStr)) return '~%';
24+
if(/^\ds/.test(formatStr)) return '~s';
2525

2626
// try adding tilde to the start of format in order to trim
2727
if(!(/^[~,.0$]/.test(formatStr)) && /[&fps]/.test(formatStr)) return '~' + formatStr;

0 commit comments

Comments
 (0)