/// Number format for numeric cells, eg 1e4 | 10000 | 10,000.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct NumberFormat {
    #[builder(default, into)]
    #[serde(rename = "sigFigs", skip_serializing_if = "Option::is_none", default)]
    sig_figs: Option<i32>,
    #[builder(default, into)]
    #[serde(rename = "displayOption", skip_serializing_if = "Option::is_none", default)]
    display_option: Option<super::NumberFormatDisplayOption>,
    #[builder(default, into)]
    #[serde(
        rename = "fixedDecimalPlaces",
        skip_serializing_if = "Option::is_none",
        default
    )]
    fixed_decimal_places: Option<i32>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::DecimalPlaces>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "decimalPlaces", skip_serializing_if = "Option::is_none", default)]
    decimal_places: Option<Box<super::DecimalPlaces>>,
}
impl NumberFormat {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    /// Include the specified number of significant figures, rounding if needed.
    #[inline]
    pub fn sig_figs(&self) -> Option<i32> {
        self.sig_figs.as_ref().map(|o| *o)
    }
    /// The base display format for the number.
    #[inline]
    pub fn display_option(&self) -> Option<&super::NumberFormatDisplayOption> {
        self.display_option.as_ref().map(|o| &*o)
    }
    #[deprecated(note = "use decimalPlaces instead")]
    #[inline]
    pub fn fixed_decimal_places(&self) -> Option<i32> {
        self.fixed_decimal_places.as_ref().map(|o| *o)
    }
    /// Options for formatting the decimal part of number.
    #[inline]
    pub fn decimal_places(&self) -> Option<&super::DecimalPlaces> {
        self.decimal_places.as_ref().map(|o| &**o)
    }
}
