Skip to content

Bug(formula): pad expects a number but errors on non-strings #448

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

Open
texastoland opened this issue Mar 12, 2025 · 0 comments
Open

Bug(formula): pad expects a number but errors on non-strings #448

texastoland opened this issue Mar 12, 2025 · 0 comments

Comments

@texastoland
Copy link

texastoland commented Mar 12, 2025

Output

Error: e.padStart is not a function

Source

'pad': (str: string, length: number, char: string) => {
return str.padStart(length, char);
},

Solution

	'pad': (num: number, length: number, char: string) => {
		return num.toString().padStart(length, char.toString());
	},
@texastoland texastoland changed the title [Bug] pad formula expects a number but errors on non-strings Bug: pad formula expects a number but errors on non-strings Apr 1, 2025
texastoland added a commit to texastoland/makemd that referenced this issue Apr 1, 2025
Fixes `Error: e.padStart is not a function`. `pad` was documented for number but implemented for string.
@texastoland texastoland mentioned this issue Apr 1, 2025
@texastoland texastoland changed the title Bug: pad formula expects a number but errors on non-strings Bug(formula): pad expects a number but errors on non-strings Apr 7, 2025
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

Successfully merging a pull request may close this issue.

1 participant