Source language: Translate to:

Wildcard in a number....

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Wildcard in a number....

Postby sakismorGR » Tue Jun 09, 2009 11:52 pm

I have a list with product code,name,price and I need to have a math expression to put 15% more in price.
So I have this script:
Math "[price]*1,15" "2" "[pricenew]"

The prices which it is like that 450.50 or 56.20 is not a problem.
But some prices is like that 3.450.50 or 1.200.30. So it is not possible to have a result only an error.

Is anybody knows a wildcard or an other way to make this works?
User avatar
Posts: 101
Joined: Sat Apr 29, 2006 10:21 pm
Location: Kavala-Greece

Postby Gaev » Wed Jun 10, 2009 4:18 am


1) I am assuming that you meant to say 1.15 in your Math command (not 1,15)

2) If you always expect [price] to include 2 digits after the final decimal point, then you can just ...
Code: Select all
StrReplace "[price]" "." "" "[price2]" ""
Math "[price2]*0.115" "2" "[pricenew]"

User avatar
Posts: 3748
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Neosoft Support » Wed Jun 10, 2009 9:44 am

Also 3.450.50 is not a valid number. It should be 3450.50
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5620
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest