Re: [Quantity-users] unit as string
Brought to you by:
berndspeiser
From: Bernd S. <ber...@un...> - 2004-07-20 14:06:05
|
Kai Ludwig wrote: > Hello Bernd, > > how can one obtain the unit as string from a > Quantity? > > e.g. "molL-1" from a concentration? I just added this to cvs. You have access to name and symbol of the storage unit of any Variable, Constant, UniqueConstant, or ReferencedVariable: unitsymbol (), unitname () or Unitsymbol (), Unitname (). All functions return a std::string with the respective item. The functions with capital first letters are static, i.e. they can be called on a type, like Time::Unitname (), while the versions with the lower case first letter must be called on an object, such as Time t; std::string result = t.unitsymbol (); Bernd -- =================================================================== Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser =================================================================== |