pub struct DmsFmt {
pub frac_digits: u8,
}Expand description
Formatter for degrees-minutes-seconds (DMS) notation.
DMS is the standard format for declination, latitude, altitude, and general angular measurements in astronomy. The sign is always explicit.
§Fields
frac_digits- Number of decimal places for the arcseconds component. Use 0 for whole arcseconds, 2-3 for sub-arcsecond precision.
§Output Format
±DD° MM' SS.ss" where:
- Sign is always shown (+ or -)
- Degrees, arcminutes are whole numbers
- Arcseconds include decimals per
frac_digits
§Example
use celestial_core::Angle;
use celestial_core::angle::DmsFmt;
let dec = Angle::from_degrees(-23.4392);
// Whole arcseconds
let fmt0 = DmsFmt { frac_digits: 0 };
assert_eq!(fmt0.fmt(dec), "-23° 26' 21\"");
// Sub-arcsecond precision (typical for catalogs)
let fmt2 = DmsFmt { frac_digits: 2 };
assert_eq!(fmt2.fmt(dec), "-23° 26' 21.12\"");Fields§
§frac_digits: u8Implementations§
Auto Trait Implementations§
impl Freeze for DmsFmt
impl RefUnwindSafe for DmsFmt
impl Send for DmsFmt
impl Sync for DmsFmt
impl Unpin for DmsFmt
impl UnsafeUnpin for DmsFmt
impl UnwindSafe for DmsFmt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more