Creating an Online Calculator for the Conversion of Shakkanhō (Japanese) Units

By James Harry Morris


When I was invited to become the editor of the Japan Studies content on Digital Orientalist, I began to reflect more fully on the problems that I have faced in my own research and the ways in which I may be able to address these digitally for both myself and others. One problem that has consistently surfaced is interaction with and more specifically the conversion of the Japanese system of measurements (shakkanhō 尺貫法) into metric measurements. In the past, I have searched for conversions in the appendices of academic texts or on sites such as Wikipedia and calculated the metric equivalent myself. After some preliminary searches, I noticed that most websites that offer free conversion calculators for Japanese units are outdated, and I, therefore, began to flirt with the idea of creating a new conversion calculator.

A new conversion calculator could easily be created in Microsoft Excel, however, an Excel file could easily be lost within a user’s hard drive and as such it would not be particularly useful to other scholars who downloaded it. The calculator could also be created as a Java Application, but I did not believe that the concept required a stand-alone piece of software. Overall, I believed that an online platform would be most useful to both myself and potential users, and I, therefore, opted to use the online system vCalc to create and host the conversion calculator. vCalc allows users, primarily in the fields of academia, construction, and finance, to create and use mathematical calculators, equations, and datasets using a combination of its own system and the programming language Apache Groovy.

Screen Shot 2018-08-08 at 20.30.37

An example of Apache Groovy as used in vCalc from my Japanese (Shokkanhō) Lengths equation.

Creating the Calculator

After signing up for an account I spent the better part of a week learning how to use the system and familiarizing myself with Groovy by reading the algorithms created by other users working on similar projects. vCalc encourages users to adapt the algorithms of others within their own work, and therefore I created an initial set of equations that converted Japanese measurements into their metric equivalents basing the project on imperial unit conversion calculators and currency calculators already present on the vCalc system. For instance, the equation I created for the length measurement, (毛 or 毫), stated that:

Millimetres /33

Later, I realized through looking at the algorithms of the equations for Biblical Lengths that a better system could be instated by creating Japanese measurements as constants (mathematical units) rather than equations, and later feeding these constants into an equation. Under the new system,  is defined as:

= 0.03030mm

I imported this information (alongside other Japanese units of length) into an equation. The equation contained a switch that created a drop-down menu allowing the user to select different units. The chosen unit is then multiplied by the numerical value that the user inputs. If a user selects , which the system understands to mean 0.03030mm based on the imported information from the above-noted data, the equation in its most basic form states that:

X = Mō Y

The vCalc system then automatically allows the output to be converted into other metric or imperial measurements.

Screen Shot 2018-08-08 at 20.31.24

The drop-down menu, and input and output boxes for the Japanese (Shokkanhō) Area equation.

I repeated this process for Japanese units of area, volume, weight, and rice weights, creating a total of 40 constants and five equations, each with their own algorithms, definitions, and Wikipedia-style information pages. Once I reached this stage, I imported my five equations into the calculator creation page in order to create a separate calculator page where all my equations could be instantaneously accessed and used. I composed the information on the page and launched the calculator, equations, and constants into vCalc’s public system, known as vCommons, making all the information, algorithms and code accessible to the public and users of the system. Making this information public also means that the information pages can be edited by other users or duplicated in order to create further constants, equations or calculators.


Shortly after launching the calculator, the President of vCalc, Kurt Heckman, sent me a personal email praising the calculator and its wiki pages. He performed some minor edits on the calculator’s wiki pages and the company began making efforts to publicize the calculator online. Due to vCalc‘s interest in the calculator, Heckman has written a blog post on vCalc‘s main site about the calculator, which can be viewed here.

Finding the Finished Product

I intend to expand the Japanese (Shakkanhō) Unit Conversion Calculator with further equations and constants, such as historical monetary weights, however, the 14.2 version (accurate at the time of writing and pictured below) can now be accessed here or through vCalc‘s mobile application, vCalc MobileI am interested in hearing users’ thoughts on the Calculator in order to improve it, so if you happen to give it a try please feel free to send me feedback. I am also flirting with the idea of turning the calculator into a stand-alone application, but that will be the topic of a potential future post.

Screen Shot 2018-08-08 at 20.33.08

A screenshot of the finished Japanese (Shakkanhō) Unit Conversion Calculator page on vCalc.


The next article in this series.

One comment

  1. Pingback: Creating an Online Calculator (2): Algorithms and Code | The Digital Orientalist

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: