Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Quick JQuery help needed
Old 11-11-2009, 10:18 AM Quick JQuery help needed
TWD
TWD's Avatar
King Spam Talker

Posts: 1,112
Trades: 0
I need script that looks for every instance on a page of numeric value with
decimal places. Then strip the decimal and the two decimal places.

Effectively, I want to truncate every currency value back to whole currency units, removing fractions or cents.

Any ideas how to do it with JQuery?
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-11-2009, 10:44 AM Re: Quick JQuery help needed
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Why do you think jQuery is going to help you with this? Are the numbers located within common tags, in some way that easy to identify with CSS selectors?
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 11-12-2009, 02:04 AM Re: Quick JQuery help needed
TWD
TWD's Avatar
King Spam Talker

Posts: 1,112
Trades: 0
I am looking for a way to parse all text nodes that contain a currency symbol like Japanese yen. Currently they are outputed with 2 decimal places which is incorrect.

Each Yen amount is a child of either a <span> or <p> tag.

I think its possible to select all the nodes which contain the symbol and then do something with them in jQuery via the contents() function:

http://docs.jquery.com/Traversing/contents

Now how do i remove any whitespace from the end of the string THEN cut the decimal and trailing two zeros (ie. the final three characters of the string)?
TWD is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Quick JQuery help needed
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12505 seconds with 12 queries