Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

formatting numbers & displaying gifs

Posted on 1998-07-23
5
Medium Priority
?
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…
Six Sigma Control Plans

636 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