Rewrite excel formula to a php statement

Posted on 2009-02-09
Last Modified: 2012-05-06
I am trying to write a php statement which come from a excel formula.
I was trying to figure out how to do the MOD in php, but I didn't know how to do it correctly. Thanks for your help.

= intval ($total)+( intval (MOD($total,1)/0.3))+(SUM(MOD($total,1))-( intval (MOD($total ,1)/0.3))*0.3)

Open in new window

Question by:dennis231
    LVL 34

    Accepted Solution

    Mod in php is done with a % sign.

    10 % 3
    Should return 1
    LVL 34

    Expert Comment

    by:Terry Woods

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now