<?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: Luvrena</title>
    <description>The latest articles on DEV Community by Luvrena (@luvrena).</description>
    <link>https://dev.to/luvrena</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%2F4253035%2Fa8b34956-b710-4514-b76a-de3f845abdb3.png</url>
      <title>DEV Community: Luvrena</title>
      <link>https://dev.to/luvrena</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luvrena"/>
    <language>en</language>
    <item>
      <title>We found a bug in our own ring size chart, so we open-sourced the fix</title>
      <dc:creator>Luvrena</dc:creator>
      <pubDate>Thu, 19 Nov 2026 05:43:52 +0000</pubDate>
      <link>https://dev.to/luvrena/we-found-a-bug-in-our-own-ring-size-chart-so-we-open-sourced-the-fix-k8k</link>
      <guid>https://dev.to/luvrena/we-found-a-bug-in-our-own-ring-size-chart-so-we-open-sourced-the-fix-k8k</guid>
      <description>&lt;p&gt;We run a small online jewelry store, &lt;a href="https://luvrena.com" rel="noopener noreferrer"&gt;Luvrena&lt;/a&gt;. Last week we turned our ring size chart into a converter and found a bug that had been sitting on the page for a long time: the whole &lt;strong&gt;EU column was wrong&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A US 7 was listed as EU 14. It should be EU 54.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong
&lt;/h2&gt;

&lt;p&gt;The EU column had been filled in with Japanese sizes. Nobody noticed, because a size chart looks plausible as long as the numbers go up.&lt;/p&gt;

&lt;p&gt;The four common systems measure different things:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;What the number means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;US / Canada&lt;/td&gt;
&lt;td&gt;A numbered scale in half steps. US 7 is about 17.3 mm across the inside.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UK / Australia&lt;/td&gt;
&lt;td&gt;Letters, with half sizes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EU&lt;/td&gt;
&lt;td&gt;The inside circumference in millimetres, rounded.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Japan&lt;/td&gt;
&lt;td&gt;Its own numbered scale. US 7 is about Japan 14.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the EU size is the one column you can calculate. A US 7 is 17.3 mm across, 17.3 × π ≈ 54.4 mm around, so it is EU 54.&lt;/p&gt;

&lt;h2&gt;
  
  
  A one-line check for any chart
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// EU size should equal the rounded inside circumference&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;checkEu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diameterMm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;euSize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;diameterMm&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;euSize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;checkEu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;17.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;54&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;span class="nf"&gt;checkEu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;17.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// false  &amp;lt;- our old chart&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Charts get copied from site to site, and the mistakes travel with them. If you maintain a store with a ring size chart, it takes a minute to run one row through this.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we published
&lt;/h2&gt;

&lt;p&gt;The corrected data and the converter are on GitHub under the MIT licence:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/luvrenajewelry/ring-size-converter" rel="noopener noreferrer"&gt;luvrenajewelry/ring-size-converter&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ring-sizes.json&lt;/code&gt;: 17 rows, US 4 to 12 in half sizes, with diameter, circumference, UK, EU and Japan&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ring-size.js&lt;/code&gt;: &lt;code&gt;convert(value, unit)&lt;/code&gt; takes a diameter, a circumference, a US size or an EU size and returns the closest row&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;index.html&lt;/code&gt;: a standalone page with no dependencies (&lt;a href="https://luvrenajewelry.github.io/ring-size-converter/" rel="noopener noreferrer"&gt;demo&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;test.js&lt;/code&gt;: asserts that every row passes the EU check above
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;convert&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'./ring-size'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;17.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'diameter'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// { us: 7, uk: 'O', eu: 54, jp: 14, ... }&lt;/span&gt;
&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;57&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'eu'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;us&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// 8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One caveat: the UK and Japanese columns follow the commonly published conversion tables, and those can differ by half a size between sources. Only the EU column is calculated. If you know of an authoritative source for the other two, an issue or pull request would be welcome.&lt;/p&gt;

&lt;p&gt;The version on our store is here: &lt;a href="https://luvrena.com/pages/ring-size-chart" rel="noopener noreferrer"&gt;luvrena.com/pages/ring-size-chart&lt;/a&gt;.&lt;/p&gt;

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