cancel
Showing results for 
Search instead for 
Did you mean: 

How to put decimal in the substring function

Former Member
0 Kudos

Hi Friends

I am having a input value which is a UDF named GetValue which is mapped with a substring (0,4) which is again mapped to a split by value and then to the target field MENGE

My problem is when value is coming from GetValue and i am mapping it to substring there i want to take the decimals also

forexample let us value coming is 2 than in the substring and then to the target field i want to send as 2.000.

Please help me how it can be done.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Aquarian,

The value which is coming from GetValue UDF, map that to a FormatNumber Function

Use the standard function 'formatnumber' with number format 0.00

double click on 'formatnumber' function in mapping editor to get number format field.

you need not put anything in the 'decimal separator' field.

this function is available in arithmetic set of standard functions.

I believe this should be it.

Let me know if you need more help.

Thanks,

Varun

Answers (6)

Answers (6)

Former Member
0 Kudos

You can use FormatNum function.

Former Member
0 Kudos

Hi,

It was answered in above post only but still I will extend it with some more details as

Use formatNumber API in Arithmatic functions in graphical mapping and double click on it.

give the expected output format as ##.000 this will give you the output as 2.000

thanks

Swarup

Former Member
0 Kudos

It might be very stupid but still ...

What is this ## my lenght is 4,3 means 4 values before the decimal and 3 after decimal.

also what should i put in Decimal seprator when i open the Format function

Thanks

Former Member
0 Kudos

HI Aquarian,

please see my earlier post in the chain, i have answered all your queries.

Thanks,

Varun

ranjit_deshmukh
Active Participant
0 Kudos

here # means any numeral

if u write as "#.000" lets take following cases:

1.input= 2

output=2.000

2.input= 2.1

output=2.100

3.input= 200.001

output=200.001

dont mention any thing in Decimal separator it is used to change the decimal point with any diff. character

e.g. if u mention it as ',' then input= 2.12 output=2,120

Ranjit

Former Member
0 Kudos

Hello,

you can use FormatNum function.

In your case you need 0000.000

The default separator is '.'

You only need to type one if you want to use a different one.

Regards

Patrick

Former Member
0 Kudos

Thanks friends its solved.

Former Member
0 Kudos

Hi,

How many decimal zero u need after ur digit.

Try this:

u can use the onstant function with .000 constant value and use the concat function give input value as first input and constant as second value.

Output will be 2.000

I dont know this is the right way of doing ot but if it works then u go for this.

Thnx

Chirag

Edited by: Chirag Gohil on Feb 11, 2008 3:06 PM

Former Member
0 Kudos

Hi

you can concatenate the putput of your UDF with the constant as .000.

so u will get the putput as 2.000(suppose).

Thanks

Rinku

ranjit_deshmukh
Active Participant
0 Kudos

use FormatNumber function

and in that use the number format as:

"#.000"

Ranjit

Former Member
0 Kudos

Hi Ranjit

I dint get it can you explain it a more.

Means you are saying that the value which is coming from GetValue UDF i map that to a FormatNumber Function ok.

What should i put in the decimal seprator of the format function.

Thanks

Former Member
0 Kudos

If you want to send 2.000 and not 2000 the you have to insert the seperator because it is a string.

Dominic

Former Member
0 Kudos

Hi aquarian,

you could use the function FormatByExample.

Dominic