karm Library API Documentation

karmutility.cpp

00001 #ifndef KARM_UTILITY_H
00002 #define KARM_UTILITY_H
00003 
00004 #include <stdlib.h>
00005 
00006 #include <kglobal.h>
00007 #include <klocale.h>
00008 #include "karmutility.h"
00009 
00010 QString formatTime( long minutes, bool decimal )
00011 {
00012   QString time;
00013   if ( decimal ) {
00014     time.sprintf("%.2f", minutes / 60.0);
00015     time.replace( '.', KGlobal::locale()->decimalSymbol() );
00016   }
00017   else time.sprintf("%ld:%02ld", minutes / 60, labs(minutes % 60));
00018   return time;
00019 }
00020 
00021 #endif // KARM_UTILITY_H
KDE Logo
This file is part of the documentation for karm Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 04:47:36 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003