I'm trying to save decimal value in DB but getting this error.
The value I'm trying to save 0.00038711029163348665 or 1.00038711029163348665 or 2.00038711029163348665, and column in DB is Decimal(18,18) not sure what I'm doing wrong
I'm trying to save decimal value in DB but getting this error.
The value I'm trying to save 0.00038711029163348665 or 1.00038711029163348665 or 2.00038711029163348665, and column in DB is Decimal(18,18) not sure what I'm doing wrong
The precision DECIMAL(18,18) means 18 total units of precision, all 18 of which come after the decimal point. You need at least one unit of precision to the left of the decimal point to handle the whole number components of the input, so you should be using DECIMAL(19,18), or something similar.
See the demo to verify that DECIMAL(19,18) resolves your problem, at least for the data you showed us.