Change parseInt to parseFloat to fix bug with decimal input
authorNick Downing <nick@ndcode.org>
Sun, 25 Nov 2018 02:27:36 +0000 (13:27 +1100)
committerNick Downing <nick@ndcode.org>
Sun, 25 Nov 2018 02:27:36 +0000 (13:27 +1100)
calculatebutton.html.jst

index 662ebae..e47ad2c 100644 (file)
@@ -16,7 +16,7 @@ return async env => {
 
     let radius_and_units = query.radius.split(' ')
 
-let radius = parseInt(radius_and_units[0])
+let radius = parseFloat(radius_and_units[0])
 let units = radius_and_units[1] || 'units'
 let area = Math.PI * radius * radius
 let circumference = Math.PI * radius * 2