Here is what I start with:
Less than $10,000
$10,000 to less than $20,000
$20,000 to less than $30,000
$30,000 to less than $40,000
$40,000 to less than $50,000
$50,000 to less than $60,000
$60,000 to less than $70,000
$70,000 to less than $80,000
$80,000 to less than $90,000
$90,000 to less than $100,000
$100,000 to less than $125,000
$125,000 to less than $150,000
$150,000 or higher
I can get close to what I need... this is what I CAN GET:
(10) Less than $10,000 ;fac=10
(15) $10,000 to less than $20,000 ;fac=15
(25) $20,000 to less than $30,000 ;fac=25
(35) $30,000 to less than $40,000 ;fac=35
(45) $40,000 to less than $50,000 ;fac=45
(55) $50,000 to less than $60,000 ;fac=55
(65) $60,000 to less than $70,000 ;fac=65
(75) $70,000 to less than $80,000 ;fac=75
(85) $80,000 to less than $90,000 ;fac=85
(95) $90,000 to less than $100,000 ;fac=95
(112.5) $100,000 to less than $125,000 ;fac=112.5
(137.5) $125,000 to less than $150,000 ;fac=137.5
(150) $150,000 or higher ;fac=150
This is what I NEED:... I need to pad the beginning numbers to the widest length of the determined midpoint AND if there's a decimal, I need to make them ALL decimals, right justified.
( 10.0) Less than $10,000 ;fac=10
( 15.0) $10,000 to less than $20,000 ;fac=15
( 25.0) $20,000 to less than $30,000 ;fac=25
( 35.0) $30,000 to less than $40,000 ;fac=35
( 45.0) $40,000 to less than $50,000 ;fac=45
( 55.0) $50,000 to less than $60,000 ;fac=55
( 65.0) $60,000 to less than $70,000 ;fac=65
( 75.0) $70,000 to less than $80,000 ;fac=75
( 85.0) $80,000 to less than $90,000 ;fac=85
( 95.0) $90,000 to less than $100,000 ;fac=95
(112.5) $100,000 to less than $125,000 ;fac=112.5
(137.5) $125,000 to less than $150,000 ;fac=137.5
(150.0) $150,000 or higher ;fac=150
I am calling the code (named cfacr) while in the file, and can not have it be an external file. It's called while in the vi editor:
:1,13 ! cfacr
I'm getting stuck on how I can determine the number of leading spaces and the decimal placement since that has to be determined AFTER the perl script runs.
Any suggestions?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.