TeraBlight
06-10-2005, 07:21 AM
I want to go from a text like this one
"Buy 5000 bricks (6000 if they have that many) for $5 each with a bonus of 25%."
to one like this one
"Buy 5,000 bricks (6,000 if they have that many) for $5.00 each with a bonus of 25%." (not "... bonus of 0.25.")
In other words, I want to reformat the numbers, partly depending on adjacent special characters. Are there any VB features that can help me here, apart from Format() and the InStr family, or will I just have to sit down and write a parser that can handle something like this?
"Buy 5000 bricks (6000 if they have that many) for $5 each with a bonus of 25%."
to one like this one
"Buy 5,000 bricks (6,000 if they have that many) for $5.00 each with a bonus of 25%." (not "... bonus of 0.25.")
In other words, I want to reformat the numbers, partly depending on adjacent special characters. Are there any VB features that can help me here, apart from Format() and the InStr family, or will I just have to sit down and write a parser that can handle something like this?