?
Solved

formatting numbers & displaying gifs

Posted on 1998-07-23
5
Medium Priority
?
209 Views
Last Modified: 2010-03-05
i have a number that shows up as a result of a calculation and its shows up with about 13 decimal places...how do i get it to only display 2 decimal places........and.....what is the coding to display a gif without using html coding....just opening a gif and displaying it?
0
Comment
Question by:qeuwtie
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
b2pi earned 200 total points
ID: 1208719
sprintf("%.2F\n", $num);

As far as displaying a gif, do you mean on the web, or on a local machine?
0
 

Author Comment

by:qeuwtie
ID: 1208720
thanks for the decimal place info....ive figured out how to add a gif image on-the-fly too....just not create one....do you have any info on creating on-the-fly gifs ...charts... from user given data...ive downloaded gd.pm...but im having a horrible time trying to use it..
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1208721
It's gd.pm that you want to look for.  Are you having specific problems with it?
0
 

Author Comment

by:qeuwtie
ID: 1208722
the gd.pm file i am using won't compile...when i try to run the example.pl it does work because of the gd.pm compilation error...it says
"Global symbol "i" requires explicit package name at GD.pm line 33 .
Variable "$i" is not imported at GD.pm line 33 .
Global symbol "i" requires explicit package name at GD.pm line 33 .
Variable "$i" is not imported at GD.pm line 33 .
Global symbol "i" requires explicit package name at GD.pm line 33 .
Variable "$i" is not imported at GD.pm line 33 .
Global symbol "i" requires explicit package name at GD.pm line 33 .
Missing right bracket at GD.pm line 33 , at end of linesyntax error at GD.pm line 33 , at EOF
BEGIN failed--compilation aborted at Graph.pm line 33 .
BEGIN failed--compilation aborted at script line 6."

i can send the example file and gd.pm file if you would like....ive just started using perl..so im not sure what the problem is ...
thank you....
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1208723
post this as a new question...  Your installation is most likely screwed...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question