ecency-mobile/src/utils/parseAsset.js

15 lines
261 B
JavaScript
Raw Normal View History

2020-10-15 00:50:40 +03:00
export default (strVal) => {
if (typeof strVal !== 'string') {
// console.log(strVal);
2020-10-15 12:29:00 +03:00
return {
amount: 0,
symbol: '',
};
2020-10-15 00:50:40 +03:00
}
const sp = strVal.split(' ');
return {
amount: parseFloat(sp[0]),
symbol: Symbol[sp[1]],
};
};