<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahesh Nalla</title>
    <description>The latest articles on DEV Community by Mahesh Nalla (@mahesh_nalla_bad4d1194550).</description>
    <link>https://dev.to/mahesh_nalla_bad4d1194550</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4187070%2F2d0b56f7-6541-4072-a096-ae954a1a1983.png</url>
      <title>DEV Community: Mahesh Nalla</title>
      <link>https://dev.to/mahesh_nalla_bad4d1194550</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahesh_nalla_bad4d1194550"/>
    <language>en</language>
    <item>
      <title>How to Calculate Percentage Increase and Decrease Using JavaScript programming skills</title>
      <dc:creator>Mahesh Nalla</dc:creator>
      <pubDate>Tue, 27 Oct 2026 06:11:35 +0000</pubDate>
      <link>https://dev.to/mahesh_nalla_bad4d1194550/how-to-calculate-percentage-increase-and-decrease-using-javascriptprogramming-skills-518c</link>
      <guid>https://dev.to/mahesh_nalla_bad4d1194550/how-to-calculate-percentage-increase-and-decrease-using-javascriptprogramming-skills-518c</guid>
      <description>&lt;p&gt;Percentages are used in many real-world applications, including shopping discounts, exam results, salary changes, business reports, and financial calculators.&lt;/p&gt;

&lt;p&gt;As a JavaScript developer, understanding percentage formulas helps you build useful web applications without relying on external libraries.&lt;/p&gt;

&lt;p&gt;In this tutorial, we will learn how to calculate percentages, percentage increases, and percentage decreases using JavaScript.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calculate a Percentage of a Number&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Suppose you want to calculate 20% of 500.&lt;/p&gt;

&lt;p&gt;The formula is:&lt;/p&gt;

&lt;p&gt;Percentage value = (Number × Percentage) / 100&lt;/p&gt;

&lt;p&gt;const number = 500;&lt;br&gt;
const percentage = 20;&lt;/p&gt;

&lt;p&gt;const result = (number * percentage) / 100;&lt;/p&gt;

&lt;p&gt;console.log(result); // 100&lt;/p&gt;

&lt;p&gt;This formula works for any numeric value and percentage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calculate Percentage Increase&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Imagine a product's price increases from ₹1,000 to ₹1,200. How do you calculate the percentage increase?&lt;/p&gt;

&lt;p&gt;Formula:&lt;/p&gt;

&lt;p&gt;Percentage increase = ((New value - Old value) / Old value) × 100&lt;/p&gt;

&lt;p&gt;function percentageIncrease(oldValue, newValue) {&lt;br&gt;
    if (oldValue === 0) {&lt;br&gt;
        throw new Error("Old value cannot be zero");&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return ((newValue - oldValue) / oldValue) * 100;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;console.log(percentageIncrease(1000, 1200));&lt;br&gt;
// 20&lt;/p&gt;

&lt;p&gt;The result is a 20% increase.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calculate Percentage Decrease&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Suppose a product's price decreases from ₹2,000 to ₹1,500.&lt;/p&gt;

&lt;p&gt;Formula:&lt;/p&gt;

&lt;p&gt;Percentage decrease = ((Old value - New value) / Old value) × 100&lt;/p&gt;

&lt;p&gt;function percentageDecrease(oldValue, newValue) {&lt;br&gt;
    if (oldValue === 0) {&lt;br&gt;
        throw new Error("Old value cannot be zero");&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return ((oldValue - newValue) / oldValue) * 100;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;console.log(percentageDecrease(2000, 1500));&lt;br&gt;
// 25&lt;/p&gt;

&lt;p&gt;The result is a 25% decrease.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build a Reusable Percentage Calculator&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can also create a reusable function to calculate what percentage one number represents of another.&lt;/p&gt;

&lt;p&gt;function calculatePercentage(part, total) {&lt;br&gt;
    if (total === 0) {&lt;br&gt;
        throw new Error("Total cannot be zero");&lt;br&gt;
    }&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return (part / total) * 100;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;console.log(calculatePercentage(45, 60));&lt;br&gt;
// 75&lt;/p&gt;

&lt;p&gt;This example shows that 45 is 75% of 60.&lt;/p&gt;

&lt;p&gt;In real applications, validate user input and handle negative numbers, invalid values, and division by zero appropriately.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Try These Calculations Without Writing Code&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you need to calculate a percentage, find an increase or decrease, or solve a quick everyday calculation, you can use this "online percentage calculator" (&lt;a href="https://toolkitsfree.com/percentage" rel="noopener noreferrer"&gt;https://toolkitsfree.com/percentage&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;It can be useful for students, developers, shoppers, and anyone who regularly works with percentages.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Percentage calculations are simple to implement with JavaScript once you understand the formulas. You can use these functions in shopping applications, financial dashboards, educational projects, and many other web applications.&lt;/p&gt;

&lt;p&gt;If you are learning JavaScript, try creating a small calculator with input fields, a calculate button, and a result display. This is a practical way to improve your programming skills.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Handle Character and Word Counts Efficiently in the Browser</title>
      <dc:creator>Mahesh Nalla</dc:creator>
      <pubDate>Thu, 15 Oct 2026 15:32:38 +0000</pubDate>
      <link>https://dev.to/mahesh_nalla_bad4d1194550/how-to-handle-character-and-word-counts-efficiently-in-the-browser-3068</link>
      <guid>https://dev.to/mahesh_nalla_bad4d1194550/how-to-handle-character-and-word-counts-efficiently-in-the-browser-3068</guid>
      <description>&lt;p&gt;Whether you are writing SEO meta tags, staging markdown documentation, or formatting raw API string inputs, keeping an exact eye on character limits is a daily task for developers and content creators alike.&lt;/p&gt;

&lt;p&gt;While most text editors have built-in counters, opening a full IDE or heavy desktop program just to check a quick string snippet breaks your active coding workflow. &lt;/p&gt;

&lt;p&gt;To solve this friction point, I built a fast, client-side &lt;a href="https://toolkitsfree.com/textcount" rel="noopener noreferrer"&gt;Online Text Counter Tool&lt;/a&gt; that counts characters, words, sentences, and total paragraphs completely in real-time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why client-side tracking matters:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Total Privacy:&lt;/strong&gt; Unlike server-side counters that pass your text data over a network, this utility processes everything locally in your browser cache. Your input text never leaves your machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant Processing:&lt;/strong&gt; Built using vanilla JavaScript event listeners (&lt;code&gt;input&lt;/code&gt;), ensuring zero delay or lag, even when pasting massive logs or paragraphs of text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean Layout:&lt;/strong&gt; Designed to be completely distraction-free with minimal UI components, so it loads instantly on both desktop and mobile devices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Future roadmap ideas
&lt;/h3&gt;

&lt;p&gt;I am planning to add regular expression (Regex) string filtering, white-space removal options, and real-time reading-time estimations to the layout next.&lt;/p&gt;

&lt;p&gt;Check out the utility here: &lt;a href="https://toolkitsfree.com/textcount" rel="noopener noreferrer"&gt;Free Word &amp;amp; Character Counter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any feedback on features, UI layout adjustments, or specific text analytics you'd like to see added, let me know in the comments below!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
