/**
 * Mixin for Vue components to provide useful data formatting
 */
export default {
    'computed': {
        'angstrom': function() {
            return '&#197;'
        },
        'electron': function() {
            return 'e<span class="super">-</span>'
        },
        'angstromSquared': function() {
            return this.angstrom + '<span class="super">2</span>'
        },
        'angstromPerPixel': function() {
            return this.angstrom + '/pix'
        },
        'electronsPerAngstromSquared': function() {
            return this.electron + '/' + this.angstromSquared
        },
    },
    'methods': {
        'pairOfValues': function(x, y, separator) {
            if (x || y) {
                return (x + separator + y).trim()
            }
            return ''
        },
        'dimensions': function (x, y) {
            return this.pairOfValues(x, y, ' x ')
        },
        'range': function (x, y) {
            return this.pairOfValues(x, y, ' - ')
        },
        'numberWithUnit': function(number, unit) {
            if (Number.isNaN(number)) {
                return 'INVALID'
            }
            if (Number.isFinite(number)) {
                return number + unit
            }
            return '&infin;'
        },
        'datumWithUnit': function(value, unit) {
            return value ? value + unit : ''
        },
        'datumOrBlank': function(value) {
            return value ? value : ''
        },
    },
}

@@ -463,16 +463,18 @@
  + '/pix
+el
 '%0A      

fix typo in formats-units.js