Solved

formatting numbers & displaying gifs

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

18 Experts available now in Live!

Get 1:1 Help Now