When adding data to jtable
Java. Lang. illegalargumentexception: cannot format given object as a number
Error.
1) Check the Add process. Convert all data types to strings and then add them. In the program, use float. tostring () to convert float to string.
2) Check the Data Type of the jtable column, which can be string or float.
Cause: the data type to be added does not match the data type defined in
The Code is as follows:
Copy codeThe Code is as follows: # include # Include # Include # Include # Include # Include # Include Using namespace std;
String do_fraction (long double val, int decplaces = 3){Ostringstream out;Char DECIMAL_POINT = '.'; // European format ','Int prec = numeric_limits Out. precision (prec); // overwrite the default precisionOut String str = out. str (); // extract the string from the streamSize_t n = str. find (DECIMAL_P
The regular expression verifies that the number format is not negative and the two digits are retained after the decimal point. The regular expression is as follows:
^ ([1-9] +) | ([0-9] + \. [0-9] {1, 2}) $
Tested. Very accurate. Attached JS judgment method:
Function checkmoneyformat (VAL ){VaR Reg =/^ ([1-9] +) | ([0-9] + \. [0-9] {1, 2}) $ /;VaR ismoneyformatright = reg. Test (VAL );Return ismoneyfo
The example in this article tells you how to format a phone number in PHP. Share to everyone for your reference. The specific analysis is as follows:
This function applies only to American phones, and Chinese phones need to be modified by themselves
function Format_phone ($phone)
{
$phone = preg_replace ("/[^0-9]/", "", $phone);
if (strlen ($phone) = = 7) return
preg_replace ("/([0-9]{3}) ([0-9]{4
Tags: SQL Server oracle keyword MySQL whereIn Oracle, if we ask for the first few rows of the table, use the keyword rownum Example: SELECT * from student where rownumIn MySQL, use the keyword limit Example: SELECT * FROM student limit 10 results in removing the first 10 rows of data or select * from student limit to represent two rows of data from the first row, i.e. the second row and the third row of data are taken outIn SQL Server, with the keyword top Example: Select Top * from student resu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.