473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

help a simple expressions in jsp

15
my problem is simple expressions in jsp
like

66.6666666%

and

i want change to

66.7%

it is my jsp coding

out.printf("%2.2f",totals);
Jun 17 '07 #1
3 2254
JosAH
11,448 Expert 8TB
What's the error then? Doesn't it compile? Are you using the correct Java version
for your JSPs (1.5 or later)?

kind regards,

Jos
Jun 17 '07 #2
bylum
15
What's the error then? Doesn't it compile? Are you using the correct Java version
for your JSPs (1.5 or later)?

kind regards,

Jos
my error is


An error occurred at line: 173 in the jsp file: /z.jsp
The method printf(String, double) is undefined for the type JspWriter

173: out.printf("%2.2f",totals);

and i use tomcat 6.0.
Jun 17 '07 #3
JosAH
11,448 Expert 8TB
my error is


An error occurred at line: 173 in the jsp file: /z.jsp
The method printf(String, double) is undefined for the type JspWriter

173: out.printf("%2.2f",totals);

and i use tomcat 6.0.
It's a compilation error then. Your 'out' object doesn't have that method. If your
JspWriter is a Writer you can always wrap it in a PrintWriter; the latter definitely
has that method implemented. Alternatively you can use a DecimalFormat
object; check the API documents.

kind regards,

Jos
Jun 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: SteveB | last post by:
However, despite being simple, I can't figure it out (maybe because I'm a newbie). I'm trying to replace a string with another string, but it simply is not working (no error messages, just won't...
15
by: Alex | last post by:
could somebody tell me the difference between those two styles: function abc(var1, var2){ /* logic in here */ } and abc = function(var1, var2){ /* logic in here */ }; When / why would I...
10
by: Harlin Seritt | last post by:
I have been looking at the Python re module and have been trying to make sense of a simple function that I'd like to do. However, no amount of reading or googling has helped me with this. Forgive...
8
by: Johnny | last post by:
I need to determine whether a text box contains a value that does not convert to a decimal. If the value does not convert to a decimal, I want to throw a MessageBox to have the user correct the...
5
by: dennis | last post by:
Hi, First of all, hi to you all. I'm working on a Delphi project wich is becoming near it's deadline. I have a very simple XSLT question wich i hope one of you folks can help me with? The...
16
by: David Ford | last post by:
I have a macro that I use across the board for freeing ram. I'd like to clean up my code so I don't get these warnings. #define sfree(x) _internal_sfree((void **)&x) #define _internal_sfree(x)...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
23
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which...
3
by: JoeW | last post by:
Sorry if I am asking something has already been asked but I am somewhat stuck on a problem with regular expressions. My task is simple: take an HTTP url and remove all the characters after the...
2
by: hcaptech | last post by:
This is my Test.can you help me ? 1.Which of the following statement about C# varialble is incorrect ? A.A variable is a computer memory location identified by a unique name B.A variable's name...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.