#ifndef __SCONTI_H #define __SCONTI_H #ifndef __REAL_H #include #endif #define CHKVALID CHECK( _valid, "Tentativo di usare uno sconto non valido!" ) class TSconto : public TObject { private: TString _exp; bool _valid; int _errorpos; real _part; static const real cento; public: TString& get( void ){ CHKVALID; return _exp; } void set( const TString& exp, bool signal = FALSE ); bool is_valid( ){ return _valid; } real sconto( ); char * scontostr( int len = 0, int dec = UNDEFINED, char pad = ' ' ){ CHKVALID; real p(sconto()); return p.stringa( len, dec, pad ); } }; #undef CHKVALID #endif