Repository navigation
feat: percentage calculator in Turkish - #27
Merged
Merged
Conversation
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.
Adds
/tr/yuzde-hesaplama/, a Turkish-only percentage page. It opens with the formula, then has five calculators stacked in one panel: a percentage of a number, what percent one number is of another, percent increase or decrease, a discounted or raised price, and the price before a discount or rise. Under each result the formula is written out with the user's numbers.Why: Semrush TR (2 Dec 2026), Keyword Overview:
Top 10 for the head term: milliyet uzmanpara (AS 95), yuzde.hesaplama.net (63), balpdijital (36), kargopek (15), getmidas (64), YouTube, hurriyet (98), hesapkurdu (62), ikas blog (43), bloomberght (71). kargopek (AS 15) and balpdijital (AS 36) sit at 3 to 5 for every variant, so a clean tool with a clear formula has a way in. There's no EN page because English searchers already have strong percentage calculators. The EN index links to the Turkish page with a badge, the same way it does for KDV.
How it works:
src/sayi.jsdoes exact decimal math on BigInt fractions. It reads Turkish input (1.250,75,-12,5) and English input (1,234.56). A lone dot counts as a thousands dot only before exactly three digits. It handles spaces, the Unicode minus and%signs. Only the displayed result is rounded, half away from zero, to the chosen number of decimals (0 to 4, default 2). When rounding drops digits, the formula shows≈and says so. Output usesIntl.NumberFormat('tr-TR').src/yuzde.jscovers the five modes. Division by zero, negative prices, discounts over 100% and working back from a 100% discount each return an error code, and the page shows each one as a sentence. Percent change divides by the absolute value of a negative start value, and the page says so whenever that applies.npm run check:pwapasses). There's a new browser-check block, and the index check now expects 18 tools. The social image ispublic/og/yuzde-hesaplama.png.Checked:
npm test(196 pass),npm run check:pwa, and the new browser-check block plus the index/404 pages at 1440 and 390 px (the fullnpm run checktimes out at the text repeater step on this machine).