This topic is locked

Cannot use decimals .any

8/18/2008 1:37:38 AM
ASPRunnerPro General questions
lefty author

I have formatted certain fields from sql statement and have been unsucesfull in using decimals under. 1.o such as .33 . I have used the following custom codes .
if isNumeric(strValue) or vartype(strValue)=14 then strValue = (CDBL(strValue) * 100) & "%"
and have also used
strValue = FormatNumber(strValue,2)
should be .01 to 9.9 ?
what I get is 1 or 2 not the two decimals such as .01 or 1.1!
both give values of 1.0 or greater when the value is under 1.0 I get 1 ?????? any ideas here.!

J
Jane 8/19/2008

Hi,
to format field as number with two decimal places just set up field as Number on the "View as" settings dialog on the Visual Editor tab.

lefty author 8/19/2008

Hi,

to format field as number with two decimal places just set up field as Number on the "View as" settings dialog on the Visual Editor tab.



Thanks Jane,

I changed from custom to Number but same problem 1.50 when added or edited shows as 1.00 on the list page.

J
Jane 8/20/2008

John,
make sure your field is set up as DECIMAL in your database.

lefty author 8/20/2008

Jane Thanks,
I changed database fields to decimals ; but now I get the following error message when adding or editing a record.
Scaling of decimal value resulted in data truncation

J
Jane 8/20/2008

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.