?
Solved

formatting numbers & displaying gifs

Posted on 1998-07-23
5
Medium Priority
?
199 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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

777 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