Jump to content

[SOLVED] Configuring Account Balance's


jschofield

Recommended Posts

Hello all,

I have a file that has money balance's in it. What I am trying to do is format the file so that anything with a balance of .$.01 - $2.00 is named a "Low" balance. Everything with a $-.01 or less is a "Negitive" balance and the even ($0.00) balances will be thrown out. Below is what I have came up with so far but does not work of course. Can anyone help me please? This has been a drawn out deal for me and I just cant get it. Thanks for all the help everyone. I really appriciate it. Johnnie

 

if (($vals[4] + 0) < 0) {

$balancetype = "Negative";

$negcount ++;

} else {

$balancetype = "Low";

$lowcount ++;

Link to comment
https://forums.phpfreaks.com/topic/61703-solved-configuring-account-balances/
Share on other sites

what is in $vals???

 

With the information you gave, I came up with this:

<?php
if($vals[4] >= .01 || $vals[4] <= 2){
         $balancetype = "Low";
         $negcount ++;
}elseif($vals[4] < 0){
         $balancetype = "Negative";
         $negcount ++;
}
?>

just some minor corrections/additions:

 

<?php

$lowcount = 0;
$negcount = 0;
$normcount = 0;
$dropped = 0;

if($vals[4] >= .01 || $vals[4] <= 2){
         $balancetype = "Low";
         $lowcount ++;
}elseif($vals[4] < 0){
         $balancetype = "Negative";
         $negcount ++;
}elseif($vals[4] == 0){
         $balancetype = 'Zero';
         $dropped++;
}else{
         $balancetype = 'Normal';
         $normcount++;
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.