Merged com.woltlab.wcf.user into WCF
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / option / user / FloatUserOptionOutput.class.php
1 <?php
2 namespace wcf\system\option\user;
3 use wcf\data\user\option\UserOption;
4 use wcf\data\user\User;
5 use wcf\util\StringUtil;
6
7 /**
8 * User option output implementation for the output of a float.
9 *
10 * @author Tobias Friebel
11 * @copyright 2001-2013 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package com.woltlab.wcf.user
14 * @subpackage system.option.user
15 * @category Community Framework
16 */
17 class FloatUserOptionOutput implements IUserOptionOutput {
18 /**
19 * @see wcf\system\option\user\IUserOptionOutput::getOutput()
20 */
21 public function getOutput(User $user, UserOption $option, $value) {
22 if (empty($value) || $value == '0') {
23 $value = 0.00;
24 }
25
26 return StringUtil::formatDouble($value, 2);
27 }
28 }