Solved

formatting numbers & displaying gifs

Posted on 1998-07-23
5
155 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 50 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now