Assign: Conversion from string "1.000.000" to type 'Integer' is not valid

maaf mau tanya, dg model data di tiap row nya seperti ini
Rp. 2.000
Rp. 1.000.000
Rp. 900

ini mau sy jumlahkan semua datanya, cuman yg jutaan g bisa di convert

Assign: Conversion from string “1.000.000” to type ‘Integer’ is not valid.

sebaiknya gimana ya

image

bisa dicoba pake ini: Cint(System.Text.RegularExpressions.Regex.Replace(“Rp 1.000.000”, “[^ 0-9]”, “”).Trim())

2 Likes

Hi @KomunitasRPAIndonesia ,

Could you try the following snippet and see if that works out for you?

Convert.ToInt32(System.Text.RegularExpressions.Regex.Replace(extractedData,"(Rp\.)|\.0+$","").Replace(".",""))

Kind Regards,
Ashwin A.K

1 Like

Hi @KomunitasRPAIndonesia

Can you share the expected output

Regards
Gokul

Hi,

Another solution:

Int32.Parse(Price,NumberStyles.Any,New System.Globalization.CultureInfo("es-ES"))

Regards,

1 Like

Hi @KomunitasRPAIndonesia

Use Assign activity

LHS → Create an variable
RHS → System.Text.RegularExpressions.Regex.Match("InputString","(?<=Rp.\s)(\d.+)").Tostring.Trim

image

Regards
Gokul

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.