ecency-mobile/src/utils/parseAsset.js
2020-10-15 12:29:00 +03:00

15 lines
261 B
JavaScript

export default (strVal) => {
if (typeof strVal !== 'string') {
// console.log(strVal);
return {
amount: 0,
symbol: '',
};
}
const sp = strVal.split(' ');
return {
amount: parseFloat(sp[0]),
symbol: Symbol[sp[1]],
};
};