Hola!
necesito su ayuda!
tengo un dato el cual lo extraigo desde un pdf, con extract document data.
he intentado de varias maneras pero no funciona, o lo convierte directamente a 4, necesito que solo muestre 3700, no quiero que muestre 3.700,00.
Explicación:
Suponiendo que “ExtractionOutput.Data.Price.Value” es una cadena. El código lo convertirá al formato decimal universal desde el formato DE. Luego lo redondeamos y lo convertimos de nuevo en cadena.
Do the inputString.Replace(“$”,“”) separately and then do the CInt(Convert.ToDecimal(inputString, System.Globalization.CultureInfo.GetCultureInfo(“de-DE”))).ToString
you can use regular expressions to first remove the currency sign and then eliminate the decimal part. You can use Regex.Replace to remove any leading currency symbols (like $, €, £, etc.) with the pattern ^[^\d]+ and then convert the result to a number using Math.Floor or CInt.
Try this
myNumber = System.Text.RegularExpressions.Regex.Replace(myNumber, “[1]+”, “”)
myNumber = Math.Floor(CDbl(myNumber))
Make sure to treat ExtractionOutput.Data.Price.Value as a string before performing the replacement and splitting. This should resolve any issues related to data types and allow you to clean and write the value correctly. @mively
first use an Assign activity to clean the value and store it in a variable, like this:
Then, in the Write Cell activity, use the variable cleanedValue as the value to write to the cell. This avoids directly writing the expression in the Write Cell input.
If You found helpful, feel free to mark as a solution!