Development environment is c + + build 2007 controls is TStringGrid when the fifth column and column 6 input value is larger (5.6 column is an integer type), 7 column calculating a decimal point, even if StringGrid1 - & gt; Cells [7] [ARow]=RoundTo (GoodsCount * GoodsPrice) is invalid, or a decimal point, tried various methods, don't know the cause of the problem, a great god give prompt, to train of thought
CodePudding user response:
Decimal point is not always occur, occasional, probability event, very depressed
CodePudding user response:
I guess not decimal, but changed to scientific notation, 5 and 6 are integers, changing CurrToStr to IntToStr try, really can't use sprintf
CodePudding user response:
5.6 also allows the decimal
CodePudding user response:
Then you have to get the value first, then add a judge how much greater than when it into IntToStr with CurrToStr otherwise
CodePudding user response:
You can use this kind of Currency, Currency is the header file & lt; Syscurr. H> , accurate to small value after four, but it is a 64 - bit integer
CodePudding user response:
Currency is accurate to four decimal point, but the problem is should not be came a decimal point, the effect is shown in figure
CodePudding user response:
Don't you want to use the integer no decimal point?