Need help with simple string formatting

Hello

I have an a number expressed as a string, but can be changed.

Basically, this is my dilemma: I have a number (for example: 4051) and I need to look like: 40,51

How can I write a formatter to transform my number in this format? The number is read from an XML file and is dynamic.

Thank you (I started to write Flex a few days previously, that it is the first time that I was hooked even remotely)
-Adam

http://livedocs.Adobe.com/flex/201/langref/MX/formatters/NumberFormatter.html

Tracy

Tags: Flex

Similar Questions

  • Need help with simple flash keys

    So I need help either direct tutorial or someone to point me in the direction of something useful.

    What I'm trying to do, is create 3 clickable flash buttons which all have a link to a small box. I want these buttons to make the text appear in the box when clicked. I want the box to be a Virgin until a button is clicked.

    EXAMPLE OF

    _______________
    | TEXT HERE |
    |                          |
    |_______________|
    ___     ___     ___
    |__|     |__|     |___|

    Thank you very much in advance.

    Strike what I said about the code being fine.  It is not (my eyes just woke up).  This is a correct coding for the way you had it.  To have the button share the same function of handler you need another approach that tests for which the button is clicked.  Instead of this approach, below I show each button has its own manager function...

    Stop();
    BTN1.addEventListener (MouseEvent.Click, mouseClick1);
    function mouseClick1(event:MouseEvent):void
    {
    gotoAndStop (2);
    }

    Btn2.addEventListener (MouseEvent.Click, mouseClick2);

    function mouseClick2(event:MouseEvent):void
    {
    gotoAndStop (3);
    }

    BTN3.addEventListener (MouseEvent.Click, mouseClick3);

    function mouseClick3(event:MouseEvent):void
    {
    gotoAndStop (4);
    }

  • Desperately need help with simple program crashing using Qt and stdlibc ++

    I have a really trivial example that I was unable to get it running no matter what I try. I use ndk2.0.1. The configuration to recreate the problem is simple; the project should link to qt (4.8.2) and stdlibc ++ (not libcpp, libstdc ++).

    (main.cpp)

    #include 
    #include 
    int main(int argc, char *argv[])
    {
        std::cout << "This doesn't work\n";
        return 0;
    }
    

    That's all. You can use any toolchain you want (ntoxg ++ or CQS), seems not to matter. If you use the string of tools qcc, you must explicitly include the paths libstdc ++ and link to him, because it uses default libcpp. Build the project: it should compile correctly. The handle bar I used is here (http://pastie.org/4018541).

    Create the folder bar and deploy. Once I have started the program at this point, it show me the splashscreen for a few seconds and quit (crash)... You will notice:

    * No log output (we expect something of the call cost)

    * a nice base file pending crash

    Browsing the ntox-gdb core file gives you:

    #0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
        at atomicity.cc:36
    36  atomicity.cc: No such file or directory.
        in atomicity.cc
    
    (gdb) backtrace
    
    #0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
        at atomicity.cc:36
    
    #1  0xb8b03471 in __exchange_and_add_dispatch (__val=,
        __mem=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/ext/atomicity.h:79
    
    #2  _M_remove_reference (this=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/bits/locale_classes.h:505
    
    #3  std::locale::~locale (this=0xb837d5fc, __in_chrg=)
        at ../../../../../libstdc++-v3/src/locale.cc:89
    
    #4  0xb8b0faa9 in ~basic_streambuf (this=,
        __in_chrg=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/streambuf:193
    
    #5  std::basic_filebuf >::~basic_filebuf (
        this=0xb837d5e0, __in_chrg=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/fstream:215
    
    #6  0xb0bbd205 in __cxa_finalize ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #7  0xb832de67 in _btext ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4
    
    #8  0xb836a265 in _fini ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4
    
    #9  0xb0bd46d3 in ?? ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #10 0xb0bd5d38 in ?? ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #11 0xb0bbd052 in _cleanup ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #12 0xb0bbd337 in exit ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #13 0x080487b0 in _start ()
    

    I have no idea what to do with this stack trace and I was not able to debug the problem more far.

    This question is particularly messed because I did not add any code to Qt on demand; just link to bookstores. Do not link to the Qt libraries will make this piece of code will work perfectly. A link to the Qt code with libcpp instead of libstdc ++ will also code to run as expected.

    This problem has been driving me crazy for the last days coueple and I would really really appreciate help or advice.

    KDAB guys told me it's a bug and they're looking into it.

  • Need help with a string here

    I am trying to write a script that will restart a group of virtual machines. If they fail to restart nicely, I stop them and restart with stop-vm and vm-start. Then, I myself by e-mail a report as to how this happened.

    I'm generating the body to report e-mail by using a string here, but it does not work and I have tried everything I can think. Any help would be appreciated. I've removed things that are sensitive to my company:

    < code >

    Add-pssnapin VMware.VimAutomation.Core

    . c:\temp\mike\Export-PSCredential.ps1
    $rebooted = @("")
    $kicked = @("")
    $kicklist = @("")
    $nobootlist = @("")

    New-VIProperty-name BootTime - ObjectType VirtualMachine-value {param ($vm) $vm. ExtensionData.Summary.Runtime.BootTime.ToLocalTime ()} - Force

    SE connect-VIServer xxxxxxx.company.name - Credential $(Import-PSCredential-chemin d'accès c:\temp\mike\credentials.enc.xml)

    $TrainPool = get-file TrainingPool | Get - VM
    foreach ($myvm in $TrainPool) {Restart VMGuest - VM $myvm - confirm: $false}

    sleep 300
    $CurrentTime = get-Date
    $MinsAgo = ($CurrentTime).addminutes(-30)

    foreach ($myvm in $TrainPool) {if ($myvm.boottime - lt $MinsAgo) {}}
    {$kicklist += $myvm}
    else {$rebooted += $myvm | select name, distribution}
    }

    foreach ($kick in $kicklist) {stop-VM - $kick VM - confirm: $false - RunAsync}

    sleep 60; $kicklist | Start-vm - runasync; sleep 120


    $CurrentTime = get-Date
    $MinsAgo = ($CurrentTime).addminutes(-30)
    foreach ($kick in $kicklist) {if ($kick.boottime - lt $MinsAgo) {$nobootlist += $kick}}
    else {$kicked += $kick | select name, distribution}
    }

    "$mailMessage = @".
    Restarted successfully these VM:
    $rebooted


    Forced these s VM to restart:
    $kicked


    It would not be possible to restart - need to check:
    $nobootlist
    "@

    Send-MailMessage-to [email protected] -of [email protected] -Credential $(Import-PSCredential-chemin d'accès c:\temp\mike\credentials.enc.xml)-sujet «Redémarrage programmé dele de bassin d'entraînement VM»-corps $mailMessage-SmtpServer smtp.company.com )

    < code >

    The mail comes, but the body only contains things that I typed in the here-string (e.g. "restarted the VM with success:", etc..)

    Thanks for your time.

    Mike

    Hello, mike_sims-

    It seems that there is a problem with the way you're trying to ouput info from the virtual machines.  These three elements that hold the info from the virtual machines are tables and will not be converted to strings as you might think.  So try to use the out-string cmdlet on these three tables in the here-string, such as:

    ...$mailMessage = @"Rebooted these VM's successfully:$(Out-String -Input $rebooted)
    
    Forced these VM's to reboot:$(Out-String -Input $kicked)
    
    These wouldn't reboot - need to check them:$(Out-String -Input $nobootlist)"@...
    

    This should then put the string - the equivalent of their production in the $mailMessage variable, and the email should have the info you're after.  How does do for you?

  • Need help with the Word format Req'd for RoboHelp

    I was asked to help a company with technical writing for an online application. All their online help is in RoboHelp. I need to create about 450 pages of extra help to complete the help system. The company is owner of RoboHelp, I did not. I understand that Word documents can be imported in RoboHelp. Where can I find the format that word documents should be so that they can be imported successfully into RoboHelp?

    Any help would be greatly appreciated.

    Welcome to the forum.

    Importing in RoboHelp Word documents can give rise to a number of problems, as you will see if you take a look at the section about this on my site. The first thing that would answer this question is to know if the company is using HR to Word or HTML HR.

    If they use HR for Word, all you need to do, is make sure that the styles you use in your documents are the standard ones they use to existing aid. Only they can tell you what they want and it is for them to sit down with you to suit the required format. Note that each topic must begin with the heading 1 style. You should also know if they want a document with 450 topics (not recommended) or 450 documents, something between the two.

    If they use HTML HR, then I suggest you create a few sample topics and make import these topics. They need to become familiar with the process and I suggest that they too see the topics on my site.

    In particular, if there are many tables, you should test they import properly.

    The company themselves will have to work closely with you on that in the early stages with several test runs. They must save their project before you import it to save a lot of grief, if things don't quite work.

    I'm sure others can add others.

  • Need help with SQL strings

    Team,

    I have a requirement in my project where I need to subscribe to a channel of sup of the main chain and store them in the other column.

    for example,.

    I have a table with 2 columns and table has more than 500 discs.

    1st column has values as follows

    "High pressure 0.5 in.

    "Plate 0.3 in.

    ' Health 3.0 in.

    "" 8721 hygienic 1.0 in ""

    My requirement is that I have to take inches part and store in the 2nd column.

    my 2nd column must contain values such as 0.3, 0.5, 1.0, 0.3

    Thanks in advance,

    RAK

    Hey, Rak,

    This sounds like a job for regular expressions, particularly REGEXP_SUBSTR.

    Exactly how depends on your specific needs.  If the number always consists of 1 or more digits on either side of a decimal point, then

    REGEXP_SUBSTR (str

    , '\d+\.\d+'

    )

    Returns the number of the largest Dim Str as string.

    I hope that answers your question.

    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.

    Point where the above expression is to produce erroneous results, and explain, using specific examples, how you get the right results from data provided in these places.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

  • Need help with simple if/then script

    I'm trying to replicate a simple if/then statement excel in a PDF form. Have tried several things, but am just not a scripter Java.  The hope that I could get help from the community.

    I have three boxes that contain information on costs. They are labeled LaborCost, MaterialCost & EquipmentCost. Later, in the form, I have two boxes of different output for the sum out of my first three boxes.  If it's a positive number and the other is a negative number.  In Excel forumla language, that's what each of the boxes would read as:

    For the 1st result if it is a positive number: @if (+ LaborCost + MaterialCost + EquipmentCost > 0, + LaborCost + MaterialCost + EquipmentCost, 0)

    For the 2nd result if it is a negative number: @if (+ LaborCost + MaterialCost + EquipmentCost < 0, + LaborCost + MaterialCost + EquipmentCost, 0)

    I think that this should be a simple thing to write, but I'm not familiar with the games of the appropriate language.

    Your colletive help is VERY appreciated.

    Steven

    Try following the calculation script customized:

    // Sum the field values, as numbers
    var sum = +getField("LaborCost").value;
    sum += +getField("MaterialCost").value;
    sum += +getField("EquipmentCost").value;
    
    // Set this field value
    event.value = sum > 0 ? sum : 0;
    

    For others, change the last line:

    Event.Value = sum< 0="" sum="" :="">

  • Need help with simple database creation in number.

    I'm trying to create a simple database in number to capture the case IDs on my place of work. After you have entered a value in the worksheet 1 details must automatically added to sheet 2. Once the case details are entered and user click on the "submit" button (could not include in the screenshot), it should appear in the sheet 2. If number offers this feature, it would be very useful for me.

    Thanks to ddvance,

    Nanan

    Why don't you just enter values directly in the second table?  You could format C and D in the context Menu.

    SG

  • Need help with simple non-registered form if is displayed.

    Hello

    I'm assembling a script complex but I will start with the first statement logice.

    Essentially at the beginning, I need to know how to write a script that uses the logic if the form is NOT saved, then display message, you need to first save the form.

    It is for this part! Thank you.

    Hello

    You can do this way.

    Acrobat/Reader uses the so-called State dirty indicator if you made changes to the form.

    var dFlag = event.target.dirty

    If (dFlag is true)

    {

    xfa.host.messageBox ("form not was not yet registered");

    }

    on the other
    {
    code to run the case...
    }
  • Need help with the string generator

    Hi all

    I'm trying to run an application on Simulator 9550 and BB JRE 5 conformity of java 1.5.

    The application crashes at startup and there is a warning on the console that says:

    WARNING! : check failed to offset opcode: cause 5: found where StringBuilder is required invoking java.lang.StringBuilder. (String)

    What can I do?

    Thanks in advance.

    All right. You must affect you the level of conformity 1.1

  • [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an auto update that's simple to install, just get this error every time

    [Error number: 0x8024400A] Need help with this error... I reinstalled XP SP1 and I can't get an automatic update that's simple to install, just get this error at each time HHHHEEEELLLPPPPP! Thank you

    I had the same problem.  But finally found a solution.  If your listing is similar to mine, then keep.  XP Media Center Edition 2005 (sp2).  AMD Athlon 64 x 2 Dual-Core, HP a1630n desktop computer.

    Go to the HP website, search for sp37394-XP sp3 Upgrade utility Microsoft for systems equipped with AMD processors.

    I had the same 0 x 80240036, 0x8024400a error, but realize my problem was really get manually downloaded sp3 and installed without continue loop crashing and not error messages.

  • Need help with my Mail window. I can't export my message to the PST format. I keep getting the message error "an error occurred during initialization of MAPI".

    Hello

    Need help with my Mail window. I can't export my message to the PST format. I keep getting the message error "an error occurred during initialization of MAPI". Y at - it solution or another method?

    Hi ErikLee,

    Do you have MS Outlook installed on your computer?

    Windows mail import and export opportunities are limited to an Outlook .pst file or an Exchange Server mailbox. They are available only if MS Outlook is installed.
    If MS Outlook is not installed and you start an import or export action, the necessary support files are not present for Windows mail complete the operation. Then I suggest you to install Outlook temporarily and see if the problem is resolved.

    Follow the instructions below and check if the problem is resolved.

    1. reboot your computer, and then start Windows Mail.
    2. on the Tools menu, click Options.
    3. in the connection tab, click on edit to open the Internet Properties dialog box.
    4. in the tab programs, click on an application other than Windows mail e-mail in the e-mail list. Click on apply and then click OK.
    5. click OK again to close the Options dialog box.
    6. exit Windows mail and restart Windows mail.

    If this does not work, I suggest you upgrade to Windows Live Mail to import or export messages that may help you resolve the issue.

    To download Windows Live Mail, visit the following Microsoft Web site:
    http://get.live.com/wlmail/overview

    For more information about Windows Live Mail, see the Microsoft Web site at the following address:
    http://windowshelp.Microsoft.com/Windows/en-us/help/4b30d3d6-abe2-46d1-a5fd-4a1ba786a1381033.mspx

    Check whether the problem is resolved.

    Please post back and let us know if it helped to solve your problem.

    Kind regards
    KarthiK TP

  • Urgent need help with String Manipulation

    Hello;
    I really need help with strings.

    Let's say I have these channels:
    \\ABC\DEF\GHI\xyz\xyz\xyz\xyz

    \\ABC\DEF\GHI\xyz\

    \\ABC\DEF\GHI\xyz\xyz\xyz\

    \\ABC\DEF\GHI

    \\ABC\DEF\GHI\

    ABC/DEF/GHI/xyz/xyz/xyz/xyz

    ABC/DEF/GHI/xyz /.

    ABC/DEF/GHI/xyz/xyz/xyz /.

    ABC/DEF/GHI

    ABC/DEF/GHI.

    I need to convert them using a SQL statement for:
    \\ABC\DEF\GHI\xyz\ or //ABC/DEF/GHI/xyz/ according to the original management / or \. Please note that the "xyz" may be repeated zero or more times. I just need one end with a trailing / or -if she had one first.

    I'm on Oracle 11.1.6 SE. I have a bunch of attempts with instr, substr and replace, but I think that regexp_replace could be better.
    Any help would be GREAT! I have a whole team waiting on me.

    Hello.

    Here is a way.

    -----------------------------------------------------------------------
    with sample_table as
    (
         select '\\ABC\DEF\GHI\xyz\xyz\xyz\xyz' str from dual union all
         select '\\ABC\DEF\GHI\xyz\' from dual union all
         select '\\ABC\DEF\GHI\xyz\xyz\xyz\' from dual union all
         select '\\ABC\DEF\GHI' from dual union all
         select '\\ABC\DEF\GHI\' from dual union all
         select '//ABC/DEF/GHI/xyz/xyz/xyz/xyz' from dual union all
         select '//ABC/DEF/GHI/xyz/' from dual union all
         select '//ABC/DEF/GHI/xyz/xyz/xyz/' from dual union all
         select '//ABC/DEF/GHI' from dual union all
         select '//ABC/DEF/GHI/' from dual
    )
    select str,
         regexp_replace(str,'(xyz([/\])*)+$','\1') new_str
    from  sample_table;
    
    STR                      NEW_STR
    ------------------------------ ------------------------------
    \\ABC\DEF\GHI\xyz\xyz\xyz\xyz  \\ABC\DEF\GHI\xyz
    \\ABC\DEF\GHI\xyz\            \\ABC\DEF\GHI\xyz\
    \\ABC\DEF\GHI\xyz\xyz\xyz\     \\ABC\DEF\GHI\xyz\
    \\ABC\DEF\GHI                 \\ABC\DEF\GHI
    \\ABC\DEF\GHI\                 \\ABC\DEF\GHI\
    //ABC/DEF/GHI/xyz/xyz/xyz/xyz  //ABC/DEF/GHI/xyz
    //ABC/DEF/GHI/xyz/            //ABC/DEF/GHI/xyz/
    //ABC/DEF/GHI/xyz/xyz/xyz/     //ABC/DEF/GHI/xyz/
    //ABC/DEF/GHI                 //ABC/DEF/GHI
    //ABC/DEF/GHI/                 //ABC/DEF/GHI/
    

    Kind regards.

  • Need help with a simple basketball game.

    Hi im new here and I need help with what makes this simple basketball game.

    Im trying to recreate this this video game. I'm not sure if it uses as2 or as3

    If someone could help me make a game like this or point me to a link on how to do it would be greatly appreciated.

    AS2 is used in the video.  If you have other issues, please post in the forum AS1/AS2.

  • Need help with the data storage store, local array and network connections

    Need help with my ESXi 4.1 installation

    My hardware:

    I built a server with an Asus P6T whitebox, i7 920, 12 Gig RAM, NIC, Intel Pro1000 PT Quad, 3ware 9650SE-12ML with 8 1.5 TB SATA green in a raid 6 array gives me about 8 + TB with a spare drive all housed within a NORCO RPC-4220 4U Rackmount Server chassis.  I also have a 500 GB SATA drive which will hold the ESXi and virtual machines.

    The network includes a firewall, Netgear Prosafe FVS336G, GS724Tv of Netgear ProSafe 24 port Gigabit Managed Switch on a dhcp cable modem internet service provider.

    I also have 2 old NetGear SC101T NAS disks (4to) I want to connect to the system how some - at a later date have... data on them and want to transfer to the new storage array. I always looking into the question of whether they will work with ESXi 4.1, or I might have to only access it through Windows XP.

    My Situation:

    I have already installed ESXi 4.1 and vsphere client with no problems and it is connected to a dhcp cable internet service.  I've set up host via a dynamic DNS service name give me a static hostname on the internet.  I installed three machines to virtual OS successfully at the moment and now want to first start by creating a multimedia storage server which will use some of this new 8 TB array, then separate data storage for use with a web server small overhead storage and a backup.  It is a domestic installation.

    Help with the data store and network:

    I was doing some reading, because I'm new to this, and it looks like I'll probably want to set up my table via ESXi as a nfs disk format.  Now, the data store is usually in another physical box from what I understand, but I put my readers and ESXi all in the same box.  I'm not sure that the best way to put in place with grouped network cards, but I want to make this work.

    I understand that in ESXi 4.1 using iSCSi LUN must be less than 2 TB, but nfs - I should be able to add a bigger partition then 2 TB (for my multimedia) in nfs, right? or should I still add it separately as a separate 2 TB drives and then extend them to get the biggest space.

    Any suggestions or direct resources showing examples on how to actually add some parts of the table as data warehouses separate nfs.  I know that to go to the configuration tab, and then select Add to storage, and then select nfs. I have not my picture, but it's here that I don't know what to do because ESXi 4.1 system already has an address, should I put the same thing to the new data store array also (will it work?), and what should I use for the name of the folder and the store of data... just do something to the top.  I thought to later install Openfiler (for a multimedia storage using this table server) as a virtual machine, use the table with esxi so that I can access the same storage space with widows and linux-based systems.

    I also know I have to find a way to better use my quad nic card... put in place of virtual switches, grouping, etc HELP?

    Any direction, assistance, similar facilities to sample, suggestions or resources that would help would be great. I did a lot of hunting, but still a little confused on how to best to put in place.

    You must think of VMDK files of large databases with records of random size guest go read some data (a DLL or an INI file), maybe write some data back, then go read other data. Some files are tiny, but certain DLLs are several megabytes. It's random i/o all and heavy on the search time. IO Opsys is small random operations that are often sequential (go read data, write data, go read other data,...) so that deadlines are critical to the overall performance. That's why people say OPS are / s of reference and forget the MBs flow. The only time where you bulk transfers are when you read media (ISO files).

    Well, now forget all this. Actually the disk activity will depend on the specific applications (database? mail server? machines compiler?), but the above is true for boots, and whenever applications are idle. You should see the profile to know.

    RAID 10 is faster (and often more reliable) than RAID 5 or RAID-6 except in certain specific cases. In General RAID 10 is ideal for many random writes, since the calculation of parity for RAID-5 and - 6 adds to the overall latency between command and response - latency is cumulative if a little slow here and a little slow it adds up to a lot of overall slow synchronous especially with e/s on a network. OTOH RAID-5 and -6 can produce faster readings due to the number of heads, so you can use it for virtual machines that transfer bulk. Test. You may find that you need several different types subdashboards for best results.

    You said 3ware, they have some good grades on their site, but don't believe it. With my 9650 that I found myself with only a couple of their recommendations-, I put the (simple) table for allocation size 256 k, nr_requests at 2 x the queue_depth and use the planner date limit. I had the habit for the Ext4 file system formatted with stride and stripe-width synced to the table and used the options large_files with fewer inodes (do not use the huge_files option unless you plan to have single VMDK files in the terabyte range). Use a cache of great reading in advance.

    Virtual machines use VMDK files in all cases except raw iSCSI LUN that they treat native disks. VMDK is easier to manage - you can make a backup by copying the file, you can move it to a PC and load it into another flavour of VMware, etc. There could be some features iSCSI to your San as a transparent migration but nothing for me. NFS has less chatter of Protocol if latency lower times to complete an operation. NFS is good to read and write a block of data, that's all it boils down to.

    UPS is good, but it won't help if something inside the machine explodes (UPS does nothing if the PC power supply goes down). If the RAID card has an option for a battery backup module, so it can contain some writings in memory and may end up the disk i/o after replacing the power supply. 3ware also limits the types of caching available if help is not installed, and you get just the right numbers with the module.

Maybe you are looking for