coldfusion - Error being thrown while using DecimalFormat() -
I am using the following code, but I am facing a problem where it is showing me values < $ 1,099.00
as the value,
I am using the code here:
#LSCurrencyFormat (the decimal number (unitPrice), 'local' , '# Session.changelocale #') Price can not be changed to a value of 1,099.00: #
with the above code , I have the following Get the error.
I tried out DecimalFormat (wrapping), but this just gives me a different error.
Try
#LSCurrencyFormat (LSParseNumber (unitprice), ' Local ',' # session.changelocale # ') #
or it is only for removing a comma.
#LSCurrencyFormat (replace (entity, ",", "", "all"), 'local', '# session.currencylocale #') #
If that does not work, you can use it to remove all non-numeric ("[^ 0-9 \. \ - \ +]", "", "ALL"), 'local Edit ',' Edit 'is right about the decimal format, and it is probably about being the source of your error (we do not know that #UniquityPrint # likes what it looks like). When working with numbers, always make sure to store them in the simplest form and display only # the decimal formations and the like, such as your priority #
For example, if I was inputting users in quantity, especially mandatory amounts, I use one of these to clean out the incompatible characters before I add the amount in the database Inserted.
And for sure, as Leah explains in the comment below, you should always store the number of appropriate data types (such as int and money) for your database provider, and you must Field type has to store 1099.42 instead of $ 1,099.42.
Comments
Post a Comment