Print rate.

@param rate Rate instance
@return rate value
422920
public static final BigDecimal printRate(Rate rate)
   {
      BigDecimal result = null;
      if (rate != null && rate.getAmount() != 0)
      {
         result = new BigDecimal(rate.getAmount());
      }
      return result;
   }
603574
public static final BigDecimal printDurationInDecimalThousandthsOfMinutes(Duration duration)
   {
      BigDecimal result = null;
      if (duration != null && duration.getDuration() != 0)
      {
         result = BigDecimal.valueOf(printDurationFractionsOfMinutes(duration, 1000));
      }
      return result;
   }
515019
func (t Trig) Rate(rate int8) Input {
	CheckRate(rate)
	(&t).defaults()
	return NewInput("Trig", rate, 0, 1, t.In, t.Dur)
}
390224
def get_rate(self, currency, date):
        
        if str(currency) == defaults.INTERNAL_CURRENCY:
            return Decimal(1)

        cached = cache.get(_cache_key(currency, date))
        if cached:
            return Decimal(cached)
        else:
            # Expect self._get_rate() to implement caching
            return Decimal(self._get_rate(currency, date))
18168
func (in In) Rate(rate int8) Input {
	CheckRate(rate)
	(&in).defaults()

	var (
		uin = NewInput("In", rate, 0, in.NumChannels, in.Bus)
		ins = make([]Input, in.NumChannels)
	)
	for i := range ins {
		ins[i] = uin
	}
	return Multi(ins...)
}
1131924
def rate():
    """"""
    auth = request.authorization

    if not auth or not check_auth(auth.username, auth.password):
        return "60/minute"
    else:
        return "600/minute"
116806
public FxRateCalculatorBuilder ratesSnapshot(final Collection<FxRate> rates) {
        if (rates != null) {
            this.ratesSnapshot.clear();
            this.ratesSnapshot = rates.stream().collect(Collectors.toMap(FxRate::getCurrencyPair, t -> t));
        }
        return this;
    }
27231
public int getRepeatRate (char ch)
    {
        KeyRecord krec = _charCommands.get(ch);
        return (krec == null) ? DEFAULT_REPEAT_RATE : krec.repeatRate;
    }
1109360
func (saw Saw) Rate(rate int8) Input {
	CheckRate(rate)
	(&saw).defaults()
	return NewInput("Saw", rate, 0, 1, saw.Freq)
}
395380
function (rate) {
      var value = parseFloat(rate);
      if (this._contains(value)) {
        this._fillUntil(this._rateToIndex(value));
        this.$input.val(value);
      } else if (rate === '') {
        this._fillUntil(0);
        this.$input.val('');
      }
    }
241370
public static String getApproximateBitRate(long bit_rate) {
		if(bit_rate<1000) return Integer.toString((int)bit_rate);
		String unitName;
		long unitSize;
		if(bit_rate<(1000*1000)) {
			unitName=" k";
			unitSize=1000;
		} else if(bit_rate<((long)1000*1000*1000)) {
			unitName=" M";
			unitSize=1000*1000;
		} else if(bit_rate<((long)1000*1000*1000*1000)) {
			unitName=" G";
			unitSize=(long)1000*1000*1000;
		} else {
			unitName=" T";
			unitSize=(long)1000*1000*1000*1000;
		}
		long whole=bit_rate/unitSize;
		if(whole<100) {
			int fraction=(int)(((bit_rate%unitSize)*10)/unitSize);
			return new StringBuilder().append(whole).append('.').append(fraction).append(unitName).toString();
		} else return new StringBuilder().append(whole).append(unitName).toString();
	}
461289
func (b Spring) Rate(rate int8) Input {
	CheckRate(rate)
	(&b).defaults()
	return NewInput("Spring", rate, 0, 1, b.In, b.Spring, b.Damp)
}
372163
public String rate(RateCondition condition) {
        String description;
        if (condition.getContext() != null && condition.getContext().get(CONTEXT_PROPERTY_DESCRIPTION) != null) {
            description = condition.getContext().get(CONTEXT_PROPERTY_DESCRIPTION);
        } else {
            description = condition.getDataId();
        }
        switch (condition.getDirection()) {
            case DECREASING:
                description += " decreasing ";
                break;
            case INCREASING:
                description += " increasing ";
                break;
            case NA:
                break;
            default:
                throw new IllegalArgumentException(condition.getDirection().name());
        }
        switch (condition.getOperator()) {
            case GT:
                description += " greater than ";
                break;
            case GTE:
                description += " greater or equal than ";
                break;
            case LT:
                description += " less than ";
                break;
            case LTE:
                description += " less or equal than ";
                break;
            default:
                throw new IllegalArgumentException(condition.getOperator().name());
        }
        description += decimalFormat.format(condition.getThreshold());
        if (condition.getContext() != null && condition.getContext().get(CONTEXT_PROPERTY_UNIT) != null) {
            description += " " + condition.getContext().get(CONTEXT_PROPERTY_UNIT);
        }
        switch (condition.getPeriod()) {
            case DAY:
                description = " per day ";
                break;
            case HOUR:
                description = " per hour ";
                break;
            case MINUTE:
                description = " per minute ";
                break;
            case SECOND:
                description = " per second ";
                break;
            case WEEK:
                description = " per week ";
                break;
            default:
                throw new IllegalArgumentException(condition.getOperator().name());
        }
        return description;
    }
273793
function rateValue()
    {
        if ( $this->RateValue === false )
        {
            /*
            $rateValue = '0.00000';
            if ( $this->attribute( 'custom_rate_value' ) > 0 )
            {
                $rateValue = $this->attribute( 'custom_rate_value' );
            }
            else
            {
                $rateValue = $this->attribute( 'auto_rate_value' );
                $rateValue = $rateValue * $this->attribute( 'rate_factor' );
                $rateValue = sprintf( "%7.5f", $rateValue );
            }
            */

            $rateValue = '0.00000';
            if ( $this->attribute( 'custom_rate_value' ) > 0 )
                $rateValue = $this->attribute( 'custom_rate_value' );
            else
                $rateValue = $this->attribute( 'auto_rate_value' );

            if ( $rateValue > 0 )
                $rateValue = $rateValue * $this->attribute( 'rate_factor' );

            $rateValue = sprintf( "%7.5f", $rateValue );

            $this->RateValue = $rateValue;
        }

        return $this->RateValue;
    }
180200
func (lftri LFTri) Rate(rate int8) Input {
	CheckRate(rate)
	(&lftri).defaults()
	return NewInput("LFTri", rate, 0, 1, lftri.Freq, lftri.Iphase)
}
1267606
public static SettingsRate get(Map<String, String[]> clArgs, SettingsCommand command)
    {
        String[] params = clArgs.remove("-rate");
        if (params == null)
        {
            switch (command.type)
            {
                case WRITE:
                case COUNTER_WRITE:
                    if (command.count > 0)
                    {
                        ThreadOptions options = new ThreadOptions();
                        options.accept("threads=200");
                        return new SettingsRate(options);
                    }
            }
            AutoOptions options = new AutoOptions();
            options.accept("auto");
            return new SettingsRate(options);
        }
        GroupedOptions options = GroupedOptions.select(params, new AutoOptions(), new ThreadOptions());
        if (options == null)
        {
            printHelp();
            System.out.println("Invalid -rate options provided, see output for valid options");
            System.exit(1);
        }
        if (options instanceof AutoOptions)
            return new SettingsRate((AutoOptions) options);
        else if (options instanceof ThreadOptions)
            return new SettingsRate((ThreadOptions) options);
        else
            throw new IllegalStateException();
    }
571754
function(rate) {
      if (!_.isNumber(rate))
        return console.error('invalid [metro] rate ' + rate)
      this.rate = Math.max(rate, 1)
    }