Number format issue

activities
studio

#1

Hi Experts,

If i m passing value as 12000 to variable then i require it as 12,000.
And when i m passing value 120000 then i require it as 120,000.

How can i acheive this…


#2

@SagarSB Check below link u will get numerous methods for doing it.


#3

Hi @SagarSB,

This will fix your case.

Regards
Balamurugan.S


#4

Can anyone show me this with we example ,
According to situation mentioned by me above


#5

@SagarSB
ex:- my=12345
my.ToString(“N0”)
output- 12,345

ex:- my=12345
my.ToString(“N”)
output- 12,345.00

There are other methods in link also u try it out


#6

@Manjuts90

if my input is 12000 then expected is 12,000.
and if 120000 then expected is 120,000.


#7

@SagarSB Are you expecting dot at the end?


#8

@Manjuts90
no


#9

@SagarSB then below method will work for u.


#10

for me this works (must be as a string)
string.format("{0:n0}", <variable.string>)


#11

@Manjuts90

what if input is 120000.

I want 120,000 for this input


#12

@SagarSB what problem u getting in above method


#13

@Manjuts90

actually i m matching this value with applications generated value.
the application generates 12,000 if value is in thousand.
so i am converting my input to 12,000 format.
but when the value generated in application is in millions as 120000 , application generate it as 120,000.
here my variable taking value 1,20,000…hence i m facing problem.


#14

@SagarSB if your value 1200000 then ur output must be 1,200,000 right?


#15

@Manjuts90

no…
if 120000 then 120,000


#16

@SagarSB i am getting that output from above method


#17

Hi @SagarSB,

Here is the example with output.

Output :

image

image

Here is the activity

File : nn.zip (1.6 KB)

Regards
Balamurugan.S


#18

@balupad14

Thank you so much i will try and let you know


#19

@balupad14

what you have pass in Properties of activities


#20

Hi @SagarSB,

Case-1
Format : “##,###”
GroupSeparator: “,”

Case-2
Format : “###,###”
GroupSeparator: “,”

Regards
Balamurugan.S