Topic
• 6 replies
• Latest Post - ‏2013-11-08T08:40:55Z by ibm_soa_gbl
Rshya
24 Posts

# Pinned topic How to change a value from .275 to 2.75 in WTX??

‏2013-10-28T18:35:39Z |

Hi All,

I have a doubt here, i have an interest rate has .2750000 in the input file and i need to show it as 2.75 in the output. How do I do this in WTX?? Please help me with this.

Thanks,

Rshya.

• vijji_WTX
126 Posts

#### Re: How to change a value from .275 to 2.75 in WTX??

‏2013-10-29T07:01:01Z

This would be very bad solution..i guess.

Interestrate=".2750000"

LEFT(TRIMRIGHT(WORD(interestrate, '.', 2)),1)+"."+MID (TRIMRIGHT(WORD(interestrate, '.', 2)),1), 2,size(TRIMRIGHT(WORD(interestrate, '.', 2))))

Any better solutions welcome

Updated on 2013-10-29T07:11:51Z at 2013-10-29T07:11:51Z by vijji_WTX
• Rshya
24 Posts

#### Re: How to change a value from .275 to 2.75 in WTX??

‏2013-11-04T20:26:04Z
• vijji_WTX
• ‏2013-10-29T07:01:01Z

This would be very bad solution..i guess.

Interestrate=".2750000"

LEFT(TRIMRIGHT(WORD(interestrate, '.', 2)),1)+"."+MID (TRIMRIGHT(WORD(interestrate, '.', 2)),1), 2,size(TRIMRIGHT(WORD(interestrate, '.', 2))))

Any better solutions welcome

Thanks vijji_WTX for your response. But the below code worked for me:

IF(MID(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 5, 1) = "0", LEFT(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 4), LEFT(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 5))

So for ex: if input has .123400, it gave me 1.234

If input had .123000, it gave me 1.23 also if input had .100000 it gave me 1.00. Unless the 3rd digit from the decimal is an actual value, it always gave me 1.00/2.99 format.

Thanks for the idea from your code :)

Thanks,

Rshya

• vijji_WTX
126 Posts

#### Re: How to change a value from .275 to 2.75 in WTX??

‏2013-11-05T02:31:04Z
• Rshya
• ‏2013-11-04T20:26:04Z

Thanks vijji_WTX for your response. But the below code worked for me:

IF(MID(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 5, 1) = "0", LEFT(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 4), LEFT(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 5))

So for ex: if input has .123400, it gave me 1.234

If input had .123000, it gave me 1.23 also if input had .100000 it gave me 1.00. Unless the 3rd digit from the decimal is an actual value, it always gave me 1.00/2.99 format.

Thanks for the idea from your code :)

Thanks,

Rshya

Good to know this  and happy to see this "

Thanks for the idea from your code :)

• TarunB
212 Posts

#### Re: How to change a value from .275 to 2.75 in WTX??

‏2013-11-07T17:04:38Z
• Rshya
• ‏2013-11-04T20:26:04Z

Thanks vijji_WTX for your response. But the below code worked for me:

IF(MID(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 5, 1) = "0", LEFT(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 4), LEFT(LEFT(RIGHT(TRIMRIGHT(interestRate Comp:In1), 6), 1) + "." + RIGHT(TRIMRIGHT(interestRate Comp:In1), 5), 5))

So for ex: if input has .123400, it gave me 1.234

If input had .123000, it gave me 1.23 also if input had .100000 it gave me 1.00. Unless the 3rd digit from the decimal is an actual value, it always gave me 1.00/2.99 format.

Thanks for the idea from your code :)

Thanks,

Rshya

I might be missing a trick here but -  why don't you just multiply the number by 10?

• Rshya
24 Posts

#### Re: How to change a value from .275 to 2.75 in WTX??

‏2013-11-07T20:05:49Z
• TarunB
• ‏2013-11-07T17:04:38Z

I might be missing a trick here but -  why don't you just multiply the number by 10?

Very true TarunB...but I am trying to attain it  for a text field.

Thanks,

Rshya

• ibm_soa_gbl
8 Posts

#### Re: How to change a value from .275 to 2.75 in WTX??

‏2013-11-08T08:40:55Z
• Rshya
• ‏2013-11-07T20:05:49Z

Very true TarunB...but I am trying to attain it  for a text field.

Thanks,

Rshya

You can change that to text by using NUMBERTOTEXT function.

Ex:

NUMBERTOTEXT(Interestrate*10)

Regards

Gopi