Negative dollars and iTextSharp - pdf

I am trying to assign a form field in a PDF through iTextSharp that has a negative dollar amount. The value is a simple string that starts with '-$'. Every time I add the value to the form using SetField, anything after the negative sing is lost. Positive dollar amounts are fine, only negative values are lost.
I am adding the value as such:
form.SetField(fieldName, fieldValue);
form is of type AcroFields, fieldName and fieldValue are both strings. I have traced down to the point where the string is being passed to SetFields, and its right there. I have also tried replacing '$' with the Unicode value to no avail. Am I supposed to escape the dollar sign? And if so, does anyone know what the escape character is?

I fixed the issue though I do not totally understand the cause. The field was defined as a multi-line text box even though it was being used as a single line. I unchecked the option for the box to be multi-line and the issue went away.

Related

NetSuite Grab any inventory numbers with lowercase letters in them

I am trying to make a saved search that shows any inventory numbers with lowercase letter(s) in it. I have tried the following formula but am not having any luck, I have tried using the match parameter but don't want to specify a position for where the lowercase letter may occur, could anyone tell me what I'm doing wrong and what I need to do to correct it?
REGEXP_INSTR({inventorynumber},'%[a-z]%')
I have this in a numeric formula criteria where it is not equal to 0.
In NetSuite Saved Search you do not need to use the wild card (%) with the character class ([]). The following 2 options should work.
REGEXP_INSTR({entityid},'[a-z]')
REGEXP_INSTR({entityid},'[[:lower:]]')

Is format ####0.000000 different to 0.000000?

I am working on some legacy code at the moment and have come across the following:
FooString = String.Format("{0:####0.000000}", FooDouble)
My question is, is the format string here, ####0.000000 any different from simply 0.000000?
I'm trying to generalize the return type of the function that sets FooDouble and so checking to make sure I don't break existing functionality hence trying to work out what the # add to it here.
I've run a couple tests in a toy program and couldn't see how the result was any different but maybe there's something I'm missing?
From MSDN
The "#" custom format specifier serves as a digit-placeholder symbol.
If the value that is being formatted has a digit in the position where
the "#" symbol appears in the format string, that digit is copied to
the result string. Otherwise, nothing is stored in that position in
the result string.
Note that this specifier never displays a zero that
is not a significant digit, even if zero is the only digit in the
string. It will display zero only if it is a significant digit in the
number that is being displayed.
Because you use one 0 before decimal separator 0.0 - both formats should return same result.

How to affix a pound sign (£) to decimal (VB.NET)

Initially there was an issue of lexicographic-ordering which caused a column of currency values to be sorted as string.
In order to sort a column of values within VB as currency this following code is utilised: m_dtTemp.Columns("P/O Value").DataType = GetType(Decimal)
which works absolutely fine, the problem now is the lack of pound sign (£) affixed to the values.
I can't see a method to include a pound sign without resorting back to type string, thus taking me back to square one. The overall goal is to retain the numerical sort functionality whilst an addition of a pound sign is affixed to the values.

What does %2.6f do in Objective C String Formatting?

Based on Apple's documentation here: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html
It's pretty easy to understand the number to the right of the decimal point is the number of digis will be rounded up...
For example, %1.2f, 123456.123456 will turn out 123456.12 and %1.4f will turn out 123456.1234...
But it looks like the number to the left of decimal does nothing.
I tried changing the number to whatever I can think of, nothing happened.
What does it do?
The number before the decimal point in the format is called the format string's width. That is, if the resultant string would involves less characters than its width, it will be left-padded with blank spaces. You don't see any change because you either aren't using a high enough number (try something ridiculous like 100 or 200), or don't have a means of properly seeing your whitespace.

Cannot input positive number when using NSNumberFormatter?

I'm using NSNumberFormatter for my NSTextField to make numbers like 1.23 display as +1.23 and -1.23 as -1.23. Everything works fine, until I tried to input directly into the text field.
If I typed in 1.23 and hit return, the form rejected the number by complaining the invalid format. What is wrong here?
I've set the format in IB completely, the the Format(+) field is +0.00, and Format(-) field is -0.00. I've also restricted the Fraction Digits to 2, Positive Prefix to + and Negative Prefix to - respectively.
How can I fix this?
You can easily do it like this: