rdataTypeToStringFmt :: FormatSpecifier -> RDataType -> String
rdataTypeToStringFmt fmt rdt =
    case fmt of 
        DefaultFormat -> rdataTypeToString rdt
        Format fspec -> 
            case rdt of
                RInt i -> printf fspec i
                RText t -> printf fspec (unpack t)
                RDate {rdate = d, dtformat = f} -> printf fspec (unpack d)
                RTime t -> printf fspec $ unpack $ rtext (rTimeStampToRText "DD/MM/YYYY HH24:MI:SS" t)
                -- Round to only two decimal digits after the decimal point
                RDouble db -> printf fspec db -- show db
                Null -> "NULL"           

-- | Turn the value stored in a RDataType into a String in order to be able to print it
-- Values are transformed with a default formatting. 
rdataTypeToStringFmt :: FormatSpecifier -> RDataType -> String
rdataTypeToStringFmt fmt rdt =
    case fmt of 
        DefaultFormat -> rdataTypeToString rdt
        Format fspec -> 
            case rdt of
                RInt i -> printf fspec i
                RText t -> printf fspec (unpack t)
                RDate {rdate = d, dtformat = f} -> printf fspec (unpack d)
                RTime t -> printf fspec $ unpack $ rtext (rTimeStampToRText "DD/MM/YYYY HH24:MI:SS" t)
                -- Round to only two decimal digits after the decimal point
                RDouble db -> printf fspec db -- show db
                Null -> "NULL"           

-- | Turn the value stored in a RDataType into a String in order to be able to print it
-- Values are transformed with a default formatting. 
rdataTypeToStringFmt fmt rdt =
    case fmt of 
        DefaultFormat -> rdataTypeToString rdt
        Format fspec -> 
            case rdt of
                RInt i -> printf fspec i
                RText t -> printf fspec (unpack t)
                RDate {rdate = d, dtformat = f} -> printf fspec (unpack d)
                RTime t -> printf fspec $ unpack $ rtext (rTimeStampToRText "DD/MM/YYYY HH24:MI:SS" t)
                -- Round to only two decimal digits after the decimal point
                RDouble db -> printf fspec db -- show db
                Null -> "NULL"           

-- | Turn the value stored in a RDataType into a String in order to be able to print it
-- Values are transformed with a default formatting. 