Show
Ignore:
Timestamp:
06/04/07 15:56:55 (3 years ago)
Author:
eevee
Message:

Fixed: I made a terrible error in my change to height_imperial and it was a mess anyway, so I have rewritten it (correctly this time).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Dex.pm

    r212 r217  
    497497=cut 
    498498 
    499 sub height_imperial { my $in = Vee::Utils::round($_[0] / 0.254, 1); ($in >= 12 && int($in / 12) . "'") . ($in - int($in / 12)) . '"' } 
     499sub height_imperial { 
     500    my $in = Vee::Utils::round($_[0] / 0.254, 1); 
     501    my $feet   = int($in / 12); 
     502    my $inches = $in - $feet * 12; 
     503    $feet    = $feet ? "$feet'" : ""; 
     504    $inches .= '"'; 
     505    return $feet . $inches; 
     506} 
    500507sub weight_imperial { Vee::Utils::round($_[0] / 4.536, 1) . ' lb' } 
    501508sub height_metric { $_[0] / 10 . ' m' }