serialize support for float types is not added in flutter and thats why i have to come to this way,so if anyone have any working example for this,ill be really thankful for that.
I have tried this way but error is coming
void mainloan::adduwr(name acc_name, string interestString, uint64_t loan_amount )
{
print("Adding underwriter", acc_name);
eosio::print("Interest String",interestString);
double interestFloat=atof(interestString);
eosio::print("Interest Double",interestFloat);
uwr_table.emplace(get_self(), [&](auto &u) {
u.acc_name = acc_name;
u.interest_rate =interestFloat;
// u.loan_amount=loan_amount;
u.giving_loan_amunt = loan_amount;
});
}
Table
struct [[eosio::table]] underwriter_info
{
name acc_name;
double interest_rate;
uint64_t giving_loan_amunt;
auto primary_key() const
{
return acc_name.value;
}
};
ERROR
error: no viable conversion from 'std::__1::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'const char *'
double interestFloat=std::atof(interestString);