HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
HK_Weight Class Reference

A Class For Managing Data For One Weight. More...

#include <Weight.h>

Public Member Functions

 HK_Weight ()
 Constructor. More...
 
int DiffPercent (HK_Weight Weight)
 Returns The Percentage Difference Between This And Input Weight. More...
 
bool IsZero ()
 Returns True If Weight Is Zero. More...
 
float GetFloat ()
 Returns Weight As Float. More...
 
int GetInt ()
 Returns Weight As Int. More...
 
string GetString ()
 Returns Weight As String. More...
 
string Round (float Number)
 Rounds Float To 3 Decimal Places. More...
 
void Set (float Weight)
 Sets The Weight Value Using A Float. More...
 
void Set (double Weight)
 Sets The Weight Value Using A Double. More...
 
void Set (int Weight)
 Sets The Weight Value Using An Int. More...
 
void Set (string Weight)
 Sets The Weight Value Using A String. More...
 

Private Attributes

float HK_WeightFloat = 0.000
 
int HK_WeightUnit = 0
 

Detailed Description

A Class For Managing Data For One Weight.

Todo:
Add Unit And Conversion Oz to Gram And Vice Versa.
Since
01/29/2020

Definition at line 24 of file Weight.h.

Constructor & Destructor Documentation

◆ HK_Weight()

HK_Weight::HK_Weight ( )

Constructor.

Definition at line 12 of file HK_Weight.cpp.

Member Function Documentation

◆ DiffPercent()

int HK_Weight::DiffPercent ( HK_Weight  Weight)

Returns The Percentage Difference Between This And Input Weight.

Definition at line 15 of file HK_Weight.cpp.

◆ GetFloat()

float HK_Weight::GetFloat ( )

Returns Weight As Float.

Definition at line 35 of file HK_Weight.cpp.

◆ GetInt()

int HK_Weight::GetInt ( )

Returns Weight As Int.

Definition at line 37 of file HK_Weight.cpp.

◆ GetString()

string HK_Weight::GetString ( )

Returns Weight As String.

Definition at line 39 of file HK_Weight.cpp.

◆ IsZero()

bool HK_Weight::IsZero ( )

Returns True If Weight Is Zero.

Definition at line 27 of file HK_Weight.cpp.

◆ Round()

string HK_Weight::Round ( float  Number)

Rounds Float To 3 Decimal Places.

Returns
String With Rounded Float

Definition at line 42 of file HK_Weight.cpp.

◆ Set() [1/4]

void HK_Weight::Set ( double  Weight)

Sets The Weight Value Using A Double.

Definition at line 54 of file HK_Weight.cpp.

◆ Set() [2/4]

void HK_Weight::Set ( float  Weight)

Sets The Weight Value Using A Float.

Definition at line 52 of file HK_Weight.cpp.

◆ Set() [3/4]

void HK_Weight::Set ( int  Weight)

Sets The Weight Value Using An Int.

Definition at line 56 of file HK_Weight.cpp.

◆ Set() [4/4]

void HK_Weight::Set ( string  Weight)

Sets The Weight Value Using A String.

Definition at line 58 of file HK_Weight.cpp.

Member Data Documentation

◆ HK_WeightFloat

float HK_Weight::HK_WeightFloat = 0.000
private

Definition at line 26 of file Weight.h.

◆ HK_WeightUnit

int HK_Weight::HK_WeightUnit = 0
private

Definition at line 27 of file Weight.h.


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