-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add fields for emission-fuel-consumption and wtlp
- Loading branch information
Showing
5 changed files
with
185 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
* mobile.de Bundle for Contao Open Source CMS | ||
* | ||
* @author Benny Born <[email protected]> | ||
* @author Michael Bösherz <[email protected]> | ||
* @license LGPL | ||
* @copyright Copyright (c) 2021, numero2 - Agentur für digitales Marketing GbR | ||
*/ | ||
|
||
|
||
namespace numero2\MobileDeAdsBundle\Util; | ||
|
||
use softark\creole\Creole; | ||
|
||
|
||
class DataUtil { | ||
|
||
|
||
/** | ||
* Converts kW to PS | ||
* | ||
* @param float kw | ||
* | ||
* @return float | ||
**/ | ||
public static function convertKwToPS( float $kw ): float { | ||
|
||
if( empty($kw) ) | ||
return 0; | ||
|
||
return ceil($kw*1.358620689655172); | ||
} | ||
|
||
|
||
/** | ||
* Converts the given text in wikisyntax to html | ||
* | ||
* @param string $text | ||
* | ||
* @return string | ||
**/ | ||
public static function wikitext2Html( string $text ): string { | ||
|
||
$parser = new Creole(); | ||
|
||
$text = html_entity_decode(str_replace('\\\\', "\\\\\r\n", $text)); | ||
|
||
return $parser->parse($text); | ||
} | ||
} |