37 auto space_pos =
s.find(
' ');
38 SYS_ASSERT((space_pos != string::npos), asset_type_exception,
"Asset's amount and symbol should be separated with space");
39 auto symbol_str =
fc::trim(
s.substr(space_pos + 1));
40 auto amount_str =
s.substr(0, space_pos);
43 auto dot_pos = amount_str.find(
'.');
44 if (dot_pos != string::npos) {
45 SYS_ASSERT((dot_pos != amount_str.size() - 1), asset_type_exception,
"Missing decimal fraction after decimal point");
49 string precision_digit_str;
50 if (dot_pos != string::npos) {
53 precision_digit_str =
"0";
56 string symbol_part = precision_digit_str +
',' + symbol_str;
61 if (dot_pos != string::npos) {
63 fract_part =
fc::to_int64(amount_str.substr(dot_pos + 1));
64 if (amount_str[0] ==
'-') fract_part *= -1;