How to put K instead of 1000

Why do Gamesalad says that this is an invalid expression?

tableCellValue( game.money /1000,1,1).."K"

Thanks

Best Answer

  • ArmellineArmelline Posts: 5,421
    Accepted Answer

    I was actually wrong.

    Needs to be:

    (tableCellValue(game.money,1,1)/1000).."K"

Answers

  • Zeus CompanyZeus Company Member Posts: 12

    tableCellValue( game.money is the money you currently have, by the way

  • ArmellineArmelline Member, PRO Posts: 5,421

    game.Money is the name of the table, so you can't divide that by 1000. If the amount you want to divide is in cell 1,1, you need to do:

    tableCellValue(game.money,1,1)/1000.."K"

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited April 2015

    Is your table name "money /1000"?

    I assume it´s not called that, and that´s the problem. You can only have the selected table in the 'table' part of TableCellValue.

    Example: If your table is called Money, it needs to be TableCellValue((game.Money),1,1)

  • Zeus CompanyZeus Company Member Posts: 12

    @Zeus Company said:
    tableCellValue( game.money is the money you currently have, by the way

    It still says Invalid expression :s

  • ArmellineArmelline Member, PRO Posts: 5,421

    @Zeus Company said:
    It still says Invalid expression :s

    Please post a screen shot of the rule.

  • Zeus CompanyZeus Company Member Posts: 12
    edited April 2015

    @NipaDidIt said:
    Is your table name "money /1000"?

    I assume it´s not called that, and that´s the problem. You can only have the selected table in the 'table' part of TableCellValue.

    Example: If your table is called Money, it needs to be TableCellValue((game.Money),1,1)

    Well it's picked from Game>Money at the Display Text expression editor

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Zeus Company said:
    It still says Invalid expression :s

    Double-check your parentheses and commas. What @Armelline is correct:

    tableCellValue(game.money,1,1)/1000.."K"

    Also make sure that game.money is in fact a table (in the Tables tab of the Home screen) and that you're selecting game.money from the drop-down Attribute Browser and not just typing it in.

    If that doesn't work, upload a screenshot to a file-sharing site and then embed/post the link here.

  • ArmellineArmelline Member, PRO Posts: 5,421

    @Zeus Company said:
    Well it's picked from Game>Money at the Display Text expression editor

    Is game.Money definitely a table?

  • Zeus CompanyZeus Company Member Posts: 12

    @Armelline said:
    Please post a screen shot of the rule.

    i1285.photobucket.com/albums/a594/Mariecolo/Sin_t_tulo__zpsa4hf1z74.png
    where "Dinero Actual" is money. I changed it so you can understand it.

  • ArmellineArmelline Member, PRO Posts: 5,421

    Can we also see a screen shot of the table?

  • Zeus CompanyZeus Company Member Posts: 12
    • Dinero Actual
    • Integer
    • 7908

    That's the only column i have

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    do this:

    (tableCellValue(game.money,1,1)/1000).."K"

    where game.money is a table name, and (tableCellValue(game.money,1,1) actually returns an numeric value.

    can you post a screenshot of your table setup, as well as what happens when you display text (tableCellValue(game.money,1,1)

  • Zeus CompanyZeus Company Member Posts: 12

    @Armelline said:
    I was actually wrong.

    Needs to be:

    (tableCellValue(game.money,1,1)/1000).."K"

    @jonmulcahy said:
    do this:

    (tableCellValue(game.money,1,1)/1000).."K"

    where game.money is a table name, and (tableCellValue(game.money,1,1) actually returns an numeric value.

    can you post a screenshot of your table setup, as well as what happens when you display text (tableCellValue(game.money,1,1)

    YES! Thank you very much!

Sign In or Register to comment.