Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 427
  • Last Modified:

Formating Dollar sign in front of digits.

O.K. all you experts . . . .You guys are two for two.   Here's another studid question.   This is probably comman knowledge for you.   How do you format a dollar sign in front of a bunch of numbers?   Thanks for you help!
0
jmeyer34
Asked:
jmeyer34
  • 2
  • 2
1 Solution
 
CoolATIGuyCommented:
What do you mean format?  What's your goal?  What language?


CoolATIGuy
0
 
jmeyer34Author Commented:
Oh, sorry . . .in Perl.   We are learning how to format  . . . .such as with %15s    . . .stuff like that.   Is this not part of formatting?   Is it as simple as just putting a dollor sign in front of my variable?
0
 
marcin79Commented:
did you try to put \$ in front of the string(numbers) ?
0
 
jmeyer34Author Commented:
Thanks!   I put what you said in front of my formating symbols.    Such as
printf "%-15s  \$10.2f  \$%8.2f\n\n", $employeename, $grosspay, $net_pay;    and it worked!   Thanks much!
0
 
marcin79Commented:
happy that i could help
for the future when you want to put a special char always put a \ before it ix if you want to put a \ in code you have to put \\

Marcin
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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now