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

add localization helper & update @styles imports #21

Merged
merged 2 commits into from
Jun 6, 2023
Merged

add localization helper & update @styles imports #21

merged 2 commits into from
Jun 6, 2023

Conversation

BilligsterUser
Copy link
Contributor

No description provided.

@BilligsterUser BilligsterUser added the enhancement New feature or request label Jun 6, 2023
Copy link
Collaborator

@KKA11010 KKA11010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 💪 Maybe it would be better to Update the formatInt() function so that it accepts 2 params and call getLanguageCode once in that function? What do you think?

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.23 ⚠️

Comparison is base (cf575ab) 44.13% compared to head (a1aa33d) 43.90%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #21      +/-   ##
==========================================
- Coverage   44.13%   43.90%   -0.23%     
==========================================
  Files          19       20       +1     
  Lines         963      968       +5     
  Branches      208      208              
==========================================
  Hits          425      425              
- Misses        476      481       +5     
  Partials       62       62              
Impacted Files Coverage Δ
src/shim.ts 0.00% <0.00%> (ø)
src/util/localization.ts 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@BilligsterUser
Copy link
Contributor Author

export function formatInt(
	val: number,
	locale?: string,
	notation: 'standard' | 'engineering' | 'scientific' | 'compact' = 'standard'
): string {
	// eslint-disable-next-line new-cap
	const numberFormatter = Intl.NumberFormat(locale ? locale : getLanguageCode(), { notation })
	return numberFormatter.format(val)
}

@KKA11010
Copy link
Collaborator

KKA11010 commented Jun 6, 2023

Thank you

@KKA11010 KKA11010 merged commit c46ca8c into cashubtc:dev Jun 6, 2023
@BilligsterUser BilligsterUser deleted the localization-helper branch June 6, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants