Hello,
I have a formula to convert a V_Wstring to Currency:
However, the result has many zeros at the end. How do I resolve this issue? Tried searching forums and none are helping.
Thanks,
Adam
Solved! Go to Solution.
@Adam_BThere are multiple ways we can remove the zeros but before that can you check your input amount field has many zeros at the end? Also can you confirm the data type of this field in the input file also would you be able to provide some input data and expected output?
Hi @Adam_B,
Based on this formula, we can see that you are trying to update the same field, which is already a string.
You don't actually need to use "ToString()" on the string field. You can simply "$" + [sum(Requisition Spend)]
In the case where your original string doesn't contain separators or decimals, e.g. 157156.
Then you could do this:
Hi @Adam_B
It looks like ToString() will only apply the formatting config if the input value is NOT a string. If the input value is a string, ToString() just passed the input value, unmodified.
OutFromInt is the result of using ToString([Sum(Requisition Spend)], 2,1) on the initial input value which is a double
OutFromString is the result of using ToString([Sum(Requisition Spend)], 2,1) after [Sum(Requisition Spend)] is converted to a string.
You can either convert your input field to a double with ToNumber before applying ToString or check the formula that initially creates [Sum(Requisition Spend)] and ensure that it's return type is a double.
If [Sum(Requisition Spend)] comes in from an input tools as a string, you can use Regex_Replace([Sum(Requisition Spend)],"(.*)\.\d*","$1.00") to truncate it to two decimal places
Dan
@martinding Thank you! That was perfect.