aboutsummaryrefslogtreecommitdiffstats
path: root/src/number.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/number.js')
-rw-r--r--src/number.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/number.js b/src/number.js
index 1a24954..7fef7f2 100644
--- a/src/number.js
+++ b/src/number.js
@@ -3,6 +3,7 @@
SVG.Number = SVG.invent({
// Initialize
create: function (value, unit) {
+ unit = Array.isArray(value) ? value[1] : unit
value = Array.isArray(value) ? value[0] : value
// initialize defaults
@@ -48,7 +49,7 @@ SVG.Number = SVG.invent({
return this.toString()
}, // Convert to primitive
toArray: function () {
- return [this.value]
+ return [this.value, this.unit]
},
valueOf: function () {
return this.value