Astro-App-Satpass2
view release on metacpan or search on metacpan
lib/Astro/App/Satpass2/FormatValue.pm view on Meta::CPAN
right_ascension => {
formatter => '_format_right_ascension',
},
},
formatter => '_format_number',
},
dimensionless => {
default => 'unity',
define => {
percent => {
factor => 100,
},
unity => {},
},
formatter => '_format_number',
},
duration => {
default => 'composite',
define => {
lib/Astro/App/Satpass2/FormatValue.pm view on Meta::CPAN
more straight forward.
The default is normally degrees, though this is overridden for
L<right_ascension|/right_ascension>.
=head2 dimensionless
A few displayed quantities are simply numbers, having no associated
physical dimension. These can be specified as:
C<percent> = display as a percentage value, without the trailing '%';
C<unity> = display unaltered.
The default is C<unity>.
=head2 duration
This dimension represents a span of time, such as an orbital period. The
units are:
lib/Astro/App/Satpass2/Locale/C.pm view on Meta::CPAN
[%- END %]
[%- CALL title.title_gravity( TITLE_GRAVITY_BOTTOM ) %]
[%- WHILE title.more_title_lines %]
[%- title.date( align_left = 0 ) %]
[%= title.time( align_left = 0 ) %]
[%= title.name( width = 8, align_left = 0 ) %]
[%= title.phase( places = 0, width = 4 ) %]
[%= title.phase( width = 16, units = 'phase',
align_left = 1 ) %]
[%= title.fraction_lit( title = 'Lit', places = 0, width = 4,
units = 'percent', align_left = 0 ) %]
[%- END %]
[%- FOR item IN data %]
[%- item.date %] [% item.time %]
[%= item.name( width = 8, align_left = 0 ) %]
[%= item.phase( places = 0, width = 4 ) %]
[%= item.phase( width = 16, units = 'phase',
align_left = 1 ) %]
[%= item.fraction_lit( places = 0, width = 4,
units = 'percent' ) %]%
[% END -%]
EOD
position => <<'EOD',
[% UNLESS data %]
[%- SET data = sp.position( arg ) %]
[%- END %]
[%- CALL title.title_gravity( TITLE_GRAVITY_BOTTOM ) %]
[%- data.date %] [% data.time %]
[%- WHILE title.more_title_lines %]
t/format_time.t view on Meta::CPAN
call_m( gmt => 1, TRUE, 'Turn on gmt' );
call_m( 'gmt', 1, 'Confirm gmt is on' );
call_m( format_datetime_width => '', 0, 'Width of null template' );
call_m( format_datetime_width => 'foo', 3,
'Width of constant template' );
call_m( format_datetime_width => 'foo%%bar', 7,
'Width of template with literal percent' );
done_testing;
1;
# ex: set textwidth=72 :
t/format_value.t view on Meta::CPAN
'First derivative of appulse (unavailable)' );
call_m( station => [], first_derivative => [], ' ',
'First derivative of station (unavailable)' );
call_m( fraction_lit => [], ' ',
'Fraction of object lit (unavailable)' );
call_m( center => [], fraction_lit => [], ' ',
'Fraction of flare center lit (unavailable)' );
call_m( appulse => [], fraction_lit => [], '0.74',
'Fraction of appulsed body lit' );
call_m( appulse => [], fraction_lit => [ places => 0, units => 'percent' ],
' 74',
'Fraction of appulsed body lit, as percent' );
call_m( station => [], fraction_lit => [], ' ',
'Fraction of observing station lit (unavailable)' );
call_m( oid => [], ' 25544', 'OID of satellite' );
call_m( center => [], oid => [], ' ',
'OID of flare center (unavailable)' );
call_m( appulse => [], oid => [], 'Moon ',
'OID of appulsing body' );
call_m( station => [], oid => [], ' ',
'OID of observing station (unavailable)' );
( run in 0.333 second using v1.01-cache-2.11-cpan-05162d3a2b1 )