S
sck10
Hello,
I just started reading about Design Patterns and UML Class Diagrams on the
web. Anyway, I have a method that I use to format currency given certain
parameters that are supplied from the dataset from SQL Server. I was going
to create another one for Fixed, Percent ect. I know I could create a
switch statement to do this, but wanted to try to use UML as a learning
process.
So I'm trying to figure out how to break up the simple method below to do
this. Any suggestions or references would be appreciated.
sck10
public class StringFormat
{
public string NumberFormater(
object CompareValue, string CompareToValue,
object FormatValue,
string StartReturn, string EndReturn)
{
string strCompareValue = Convert.ToString(CompareValue);
double dblFormatValue;
string strFormatValue;
if(strCompareValue == CompareToValue)
{
dblFormatValue = Convert.ToDouble(FormatValue);
return StartReturn + string.Format("{0:C0}", FormatValue) + EndReturn;
}
else
{
return string.Format("{0:C0}", FormatValue);
} // end if
}
}
I just started reading about Design Patterns and UML Class Diagrams on the
web. Anyway, I have a method that I use to format currency given certain
parameters that are supplied from the dataset from SQL Server. I was going
to create another one for Fixed, Percent ect. I know I could create a
switch statement to do this, but wanted to try to use UML as a learning
process.
So I'm trying to figure out how to break up the simple method below to do
this. Any suggestions or references would be appreciated.
sck10
public class StringFormat
{
public string NumberFormater(
object CompareValue, string CompareToValue,
object FormatValue,
string StartReturn, string EndReturn)
{
string strCompareValue = Convert.ToString(CompareValue);
double dblFormatValue;
string strFormatValue;
if(strCompareValue == CompareToValue)
{
dblFormatValue = Convert.ToDouble(FormatValue);
return StartReturn + string.Format("{0:C0}", FormatValue) + EndReturn;
}
else
{
return string.Format("{0:C0}", FormatValue);
} // end if
}
}