I have to extract the left most amount and the number of days from the below attached text string and perform mathematical operations depending on the number of days.
[TABLE="width: 322"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Condition [/TD]
[/TR]
[TR]
[TD]$280 for days 1 through 6, $0 afterwards[/TD]
[/TR]
[TR]
[TD]$240 for days 1 through 3, $0 afterwards[/TD]
[/TR]
[TR]
[TD]$290 for days 1 through 4, $10 afterwards[/TD]
[/TR]
[TR]
[TD]$280 for days 1 through 5, $10 afterwards[/TD]
[/TR]
</tbody>[/TABLE]
Final sum for all the below rows to be calculated according to logic.
Amount*4 ( If number of days if >=4)
Amount*number of days( If number of days is less than 4)
Example
1) The first sum should be 280*4
2) second sum should be 240*3
[TABLE="width: 322"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Condition [/TD]
[/TR]
[TR]
[TD]$280 for days 1 through 6, $0 afterwards[/TD]
[/TR]
[TR]
[TD]$240 for days 1 through 3, $0 afterwards[/TD]
[/TR]
[TR]
[TD]$290 for days 1 through 4, $10 afterwards[/TD]
[/TR]
[TR]
[TD]$280 for days 1 through 5, $10 afterwards[/TD]
[/TR]
</tbody>[/TABLE]
Final sum for all the below rows to be calculated according to logic.
Amount*4 ( If number of days if >=4)
Amount*number of days( If number of days is less than 4)
Example
1) The first sum should be 280*4
2) second sum should be 240*3