Obtaining a monetary symbol

Hi again

I am building an app BB10 using waterfalls and qml, but I need to use a little bit of C++ (which I have not used for many years).

What im trying to do is to get the monetary symbol devices. So that's what I did:

I created a function c ++ in app.cpp as follows:

char const * app::getCurrencySymbol() {

  QLocale cs;
  return (cs.currencySymbol().toUtf8().data());
}

in my qml, I use as follows (for a test I have but it work on click of a button):

onClicked: {
  lbTest.text = app.getCurrencySymbol();
}

but "undefined" gets displayed on the label.

I am sure that the problem is with my c ++ because if I change my function to return say a double, the value indicates on the label.

QLocale () .name () returns the equivalent of your java example, and have you tried to do your getCurrencyMethod() returns a QString? I thought that's what the QML system supported, don't think tank she supported *.

Tags: BlackBerry Developers

Similar Questions

  • Flex export to Excel ' £' a currency symbol is not good screen

    Hello

    When we export a symbol of money as "£" to excell in flex environment then it is not correctly display it see the undesirable character before and after the monetary symbol.

    For more excel I generate the html and html tag string and convert this string to ByteArray and keep this ByteArray as an .xls file.

    Need help to get the good currecy symbol in excel file.

    Thanks in advance.
    Mohit.

    I just get response to display the currency symbol appropriate while export to excel from flex and the string is html.

    Solution:

    Here, you have to put unicode currency symbol:
    i.e. If you want sharp sign display and then used "£" code instead of the symbol "£".

    In link below, you will find the most special character unicode

    http://dmcritchie.MVPs.org/REXX/htm/symbols.htm

    If excel is read unicode and display the appropriate symbol / specificity according to unicode.

  • Thousands separator rejected

    I have 3.6 numbers running on a Mac Powerbook.  Is there a way to obtain cells accepted numbers pasted value that contains thousands separator (comma, for example, cut and paste from a financial statement online).  It's silly and also frustrating to have to remove in order to avoid the red triangle format error, when the cell is already set to show it again!

    I can copy and paste (for example $23 500,00) from the following sources and just paste the value in a cell to v3.6.1 numbers with the cell format set to automatic. The original formatting is preserved.

    1. A cell of table Pages v5.6.1
      1. To the currency format, 2 decimals, and thousands separator
    2. A table of v5.1.2.2 of LibreOffice Calc cell
      1. To the currency format, 2 decimals, and thousands separator
    3. Text of document Pages v5.6.1
      1. $23 500,00
    4. Text of the document of LibreOffice Writer v5.1.2.2
      1. $23 500,00 < tab > 43,250.33 < tab > 50,000.00
      2. Values passed in three adjacent cells, but only the first value retains its monetary symbol. Other values retain thousands separator and decimal, but cell format for each value is automatic, no change.
  • "$US" automatically... How to make this stop?

    Hello

    I have "joint currency" spreasheet

    But the numbers seem to AUTOMATICALLY add a 'US' before ' $'.

    How to make this STOP?

    Thank you very much

    Troy

    Hi Troy,

    This is probably connected with the region setting in system preferences > language and text. Several countries use the sign $ as their monetary symbol.

    Browse from the context menu in the preferences to see which is the "naked" in your area and who to choose as your marker for amounts in US dollars.

    The symbol has no effect on the number of underlyings.

    Kind regards

    Barry

  • How compile/link xnet with eclipse for the cRIO 9068

    Hi all

    I use a cRIO 9068 with a NI9862 (DRUM unit).

    I'm programming in C/C++ with Eclipse on windows

    Without seeking to CAN access via xnet, the C app compiles and works very well on the 9068.

    Now, I want to use xnet functions to access the CAN.

    I found a nixnet.h in \Shared\ExternalCompilerSupport\C\include, then the compiler is convinced.

    But the linker can't find a library (I tried "nixnet" and "xnet") or don't find a library for cRIO xnet 9068 on my hard drive.

    Where can I find this library? Do I have to install another driver in addition to the normal driver xnet xnet (I installed, version 14.0).

    Thanks for your response in advance

    Hello!

    the driver Readme reads as follows:

    The NOR-XNET software supports Microsoft Visual C/C++ version 6.

    But for Linux-RT based targets (cRIO 906 x and x 903) in combination with modules XNET (986 x) I found a useful resource that indicates that you should be able to include the header "nixnet.h" (as apparently already do you) and ' link against libnixnet.so at run time to obtain the appropriate symbols.

    You should find the file according to the following folder:

    C:\Program Files (x 86) \National Instruments\RT Images\NI-XNET\Linux-armv7

    Best regards

    Christoph

  • Loading wrong currency

    Hi Experts,

    When I am loading of currency values as well as monetary symbol the monetary symbol laden with undesirable character

    Using 11.1.1.7 version... all work around please...

    Is - this problem of NLS parameter, if so what value I need to change...

    Best regards

    ASP.

    Champion Hi Odi,

    I solved the problem... That's the problem with UTF character set. That solved the problem

    The same solution for Arabic characters not being loaded correctly

    Best regards

    ASP.

  • How to get a cents sign into InDesign CS6

    How to get a cents sign into InDesign CS6

    The simplest is to open the glyphs Panel, then choose "Currency" in the menu drop-down menu, which will show you all the monetary symbols, if you do not have to browse through hundreds of glyphs to find the one you want. Document of Geek: how to locate the Greek letters and math without going crazy symbols

  • JavaScript for forms

    I'm trying to get this form to calculate a product. I need to read only area that will calculate to be empty when there is nothing to calculate against. I calculated the price of end of expenses by the amount of late fees. The quantity is the field that's going to change by the person filling out the form. So I want the total field to show the cost and it will then be added to the other totals in column and another area will calculate this amount.

    The preview form looks like this:

    Capture2.JPG

    The two white fields are requiring to be empty so that if a user wants to print and fill out by hand, there is a space for them to write any calculated fields.

    Mode change my form looks like this:

    Capture3.JPG

    My Script for the empty field 'US_LateFeeSubTotal' is:

    var A = this.getField("LateFeeQuantity").value;
    var B = this.getField("LateFee").value;

    If (A > 0) event.value = A * B;
    else event.value = "";

    I have oil fields of 'LateFeeQuantity' and 'US_LateFeeSubTotal' defined as number Format. Obviously, I set to 0 decimal places and the other a game to 2 decimals with one $ above the calculated amount.

    When I go to the preview mode and type 1 in the field "LateFeeQuantity", I get the following error:

    Capture.JPG

    What I am wondering if I need to change my formula of 'A > 0' to something like "has! "=" "" or in other words if 'A is not null,' I just don't know what the syntax is or if that's really what my problem is.

    For any help or suggestion would be greatly appreciated.

    He did...

    As I thought, you have included the monetary symbol inside the price field values. Change their default values for just a number and then set their Format option to display the symbol monetary, as with the computed fields and it should work.

  • JavaScript in a text field to show/hide a field calculated

    Thanks for your help. Here's the situation. I created a form with text, number fields (currency) fields and calculated fields. Fields display calculated the monetary symbol (even when there is nothing to calculate) and this is a problem for our users who want to just print the form and fill it out by hand (because the monetary symbols get in the way.). So I wanted to write a script would make it calculated fields hidden unless there is actually something is entered in the first text field (EmpID). That's what I came with (TotalCompensationRow1 is a calculated field.):

    var TotalCompensationRow1Fld = this.getField ("TotalCompensationRow1")

    If {(event.value)
    TotalCompensationRow1Fld. display = display.hidden
    }

    else {}
    TotalCompensationRow1Fld. display = display.visible
    }

    Somehow, I think I make it much more difficult that it should be. Thanks again for your help.

    Another approach would be to change the formatting of the displayed field. When using a percentage or a monetary symbol, can not suppress the display of the "0.00"or "0.00%". " But if one use the number format with no currency symbol, you can remove the display "0.00".

    Validation of currency format:

    var nDec = 2; set the number of decimal places; number & percent;

    var sepStyle = 0; style of thousands separator; number & percent;

    var negStyle = 0; negative style; number only;

    var currStyle =""; always null; number only;

    var strCurrency = ""; currency symbol; number only;

    var strCurrencyCurrency = ' $'; currency symbol; number with the currency symbol;

    var bCurrencyPrepend = false; prefix of currency; number only;

    var bPercentPrepend = false; percentage of prefix; percent only;

    Console.println (Event.value);

    If (event.value == 0 | event.value == "") {}

    Event.Value = "";

    AFNumber_Format (nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend);

    } else {}

    bCurrencyPrepend = true;

    AFNumber_Format (nDec, sepStyle, negStyle, currStyle, strCurrencyCurrency, bCurrencyPrepend);

    }

    Validation of the percentage format:

    nDec var = 1; set the number of decimal places; number & percent;
    var sepStyle = 0; style of thousands separator; number & percent;
    var negStyle = 0; negative style; number only;
    var currStyle =""; always null; number only;
    var strCurrency = ""; currency symbol; number only;

    var strCurrencyCurrency = ' $'; currency symbol / / number with currency symbol;
    var bCurrencyPrepend = false; prefix of currency; number only;
    var bPercentPrepend = false; percentage of prefix; percent only;
    If (event.value == 0 | event.value == "") {}
    Event.Value = "";
    AFNumber_Format (nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend);
    } else {}
    AFPercent_Format (nDec, sepStyle, bPercentPrepend);
    }

  • Show/hide form fields

    Thanks in advance for your help. I work with a form that contains calculated fields. The calculated field is formatted for currency, so it contains the "$0.00" in the field automatically. Customers can also print the form and fill it out by hand, so the "$0.00" is a nuisance. Is it possible that I can hide the calculated field, unless the user has actually enters data fields to be calculated? Any advice would be appreciated. Thank you.

    The United States of the monetary symbol does not authorize the removal of the display of zero with a string NULL. So you can either set the fields do not use the currency symbol or dynamically change field with JavaScript format.

    For the validation script, use the following code:

    validation code custom;

    var cCurrency = ""; Disable the currency symbol;

    If (event.value! = 0) {}

    Event.Value = event.value;

    currency symbol set at USD

    cCurrency = ' $';

    } else {}

    value zero set value of field to null

    Event.Value = "";

    }

    Set the format with or without currency symbol field.

    AFNumber_Format (2, 0, 0, "", cCurrency, true);

    Code of end of validation custom;

    The number of decimal places is supposed to be 2.

    The form will need to be cleared or perform a calculation for calculated fields will be updated and the validation script will be executed before we see the results of this change.

  • What are the languages available in LiveCycle Designer 8.2

    Hi, I recently received a Russian Acrobat 9 Professional only to see that there are only English in LiveCycle Designer 8.2 which makes me worried if it is authentic or not. Therefore, I would like to know if this is normal and indeed LiveCycle Designer 8.2 is available in which languages?

    The product of Designer is localized in English, French, German and Japanese. It supports the creation of forms with dates, hours, digital formats and monetary symbols in many places.

    Steve

  • How to set a value in a numeric field based on a checkbox field?

    I try to get a numeric field to return to a certain numerical value according to the response from the user for a checkbox control. Here is my code:

    If (CheckBox1 .rawValue [0] == 1) then $.rawValue == 969.00 else $.rawValue == "" endif

    When the form is displayed, the value of the numeric field poster in the form $1,00 and if I check the box it changes $ 0.00 - but I want him back $969,00 if checked and be empty when not checked.

    Can someone help me understand this?

    Hello

    FormCalc syntax, so make sure that you have set the language in the script in FormCalc Editor.

    Also, you are right when you test equal to use the double equal sign ==. However, when you set a value, you use a single equal sign.

    FormCalc does not need the .rawValue.

    Make sure you have set the 'specify values' tab of object/link check box and on = 1. [0] in your script also indicates that there is more than one occurrence of CheckBox1. I'd be inclined to objects of unique name, as it makes it easier to script.

    So it should work in the case of calculating the numeric field:

    if (CheckBox1 == 1) then
         $ = 969.00
    else
         $ = 0.00
    endif
    

    Configures the model of the numeric field for monetary symbols, etc.

    Good luck

    Niall

    PS you can put figs in quotes. Also having the calculate event script will automatically make the calculated - read only field. You can, but if you do not you can change it in the tab/value of the object. On the other hand, you can have a script similar to the output of the box event.

  • Fusion 7.1.0 obtained just hit with "unable to retrieve the kernel symbols.

    Hello

    7.1.1 that did not work, I tried update

    tried to come back with TM on VM file, no luck.

    Pointers would be appreciated!

    ilandmac

    If you use Fusion 7.x for Mac OS X 10.9.x, almost certainly your host OS is in an inconsistent state.  Merger depends on some very low level of the Mac OS X host, and the error you see suggests that these low-level features do not work as expected.

    See my post on the subject here: Re: impossible to recover the kernel symbols

    See you soon,.

    --

    Darius

  • Obtain and hide all symbols of the child

    I would like to identify all instances of symbols of child of my symbol mT and hide.

    Something like this (except that it does not work):

    childsymbols_d1 = sym.getSymbol("holder").getSymbol("d1").getSymbol("mT").getChildSymbols();
    
    for(var i=0; i<childsymbols_d1.length; i++){ 
              childsymbols_d1[i].hide();
    };
    

    I don't want to use the timeline, because I have many symbols of the child and would like to make this operation on several other symbols.

    I tried and it works.

    I grouped the symbols in your in a div called Rect.

    sym.getSymbol("holder") .getSymbol ("d1").getSymbol("mT"). $('rect') .children () .hide ();

  • How can I get Firefox to load the font "Symbol" and "Wingdings"?

    My 8.0.1 version doesn't have a 'symbol' or the fonts 'Wingdings' listed and when I visited my html document these characters end up using the Arial font. I have the documents with a lot of less-than-and-equal, more-than-and-equal and a crowd of other symbols, and wingdings characters. IE9 works very well. Chrome has the same problem that Firefox has.

    You have not been able to do in Firefox since Firefox 2, and even in this case, you may need to change Firefox, so while you might change your Firefox would not very many Firefox users who could use them.

    All the browser support unicode, but all the unicode fonts are not the same size and no machine each of them will not in all fonts. If they are your own documents, you will need to convert yourself. Most of what you need, you can probably obtain directly from this page

    If not, you can check the links at the top of this page.

Maybe you are looking for