module Codec.Xlsx.Types.Internal.NumFmtPair where
import Data.Text (Text)
import Codec.Xlsx.Parser.Internal
import Codec.Xlsx.Writer.Internal
newtype NumFmtPair = NumFmtPair
{ unNumFmtPair :: (Int, Text)
} deriving (Eq, Show)
instance FromCursor NumFmtPair where
fromCursor cur = do
fId <- fromAttribute "numFmtId" cur
fCode <- fromAttribute "formatCode" cur
return $ NumFmtPair (fId, fCode)
instance ToElement NumFmtPair where
toElement nm (NumFmtPair (fId, fCode)) =
leafElement nm [ "numFmtId" .= toAttrVal fId
, "formatCode" .= toAttrVal fCode ]