foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
pfc::format_fixedpoint

#include <string_base.h>

Public Member Functions

 format_fixedpoint (t_int64 p_val, unsigned p_point)
 
const char * get_ptr () const
 
 operator const char * () const
 
const char * toString () const
 

Private Attributes

string_formatter m_buffer
 

Detailed Description

Definition at line 643 of file string_base.h.

Constructor & Destructor Documentation

pfc::format_fixedpoint::format_fixedpoint ( t_int64  p_val,
unsigned  p_point 
)

Definition at line 597 of file string_base.cpp.

598 {
599  unsigned div = 1;
600  for(unsigned n=0;n<p_point;n++) div *= 10;
601 
602  if (p_val < 0) {m_buffer << "-";p_val = -p_val;}
603 
604 
605  m_buffer << format_int(p_val / div) << "." << format_int(p_val % div, p_point);
606 }
string_formatter m_buffer
Definition: string_base.h:651

Member Function Documentation

const char* pfc::format_fixedpoint::get_ptr ( ) const
inline

Definition at line 647 of file string_base.h.

647 {return m_buffer;}
string_formatter m_buffer
Definition: string_base.h:651
pfc::format_fixedpoint::operator const char * ( ) const
inline

Definition at line 648 of file string_base.h.

648 {return m_buffer;}
string_formatter m_buffer
Definition: string_base.h:651
const char* pfc::format_fixedpoint::toString ( ) const
inline

Definition at line 649 of file string_base.h.

649 {return m_buffer;}
string_formatter m_buffer
Definition: string_base.h:651

Field Documentation

string_formatter pfc::format_fixedpoint::m_buffer
private

Definition at line 651 of file string_base.h.


The documentation for this class was generated from the following files: