misterstick
Programmer
i'm fairly new to c#, so please forgive me if i don't explain this clearly.
i have a form which displays data from an oracle database.
each column of the table is displayed in its own textbox object.
i'd like numbers to be displayed with an appropriate format; eg a currency value to be to two decimal places, or "#,##0.00".
i have bound the databinding("text").format event to a custom function, which formats the text in the way i want.
however, my first guess has been to create one function for each format, viz FormatNumber0DP, FormatNumber1DP, etc.
this works, but isn't very concise.
my question is, how can i pass the required format to the custom function, so that i can use just the one for all my textboxes, no matter what format they need to be in.
thanks,
mr s. <
i have a form which displays data from an oracle database.
each column of the table is displayed in its own textbox object.
i'd like numbers to be displayed with an appropriate format; eg a currency value to be to two decimal places, or "#,##0.00".
i have bound the databinding("text").format event to a custom function, which formats the text in the way i want.
however, my first guess has been to create one function for each format, viz FormatNumber0DP, FormatNumber1DP, etc.
this works, but isn't very concise.
my question is, how can i pass the required format to the custom function, so that i can use just the one for all my textboxes, no matter what format they need to be in.
thanks,
mr s. <