What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-10 07:44:03
pd set output to currency
#make large numbers more readable by adding commas pd.options.display.float_format = '{:,}'.format # Example 123456789.12345 -> 123,456,789.12345 #this adds commas and limits decimals to 2 places pd.options.display.float_format = '{:,.2f}'.format # Ex... Add solution -
Other 2021-10-10 06:23:05
custom function for woocommerce price format
/** * Format price to WooCommerce standards * * @access public * @param float $price * @return string */ public function format_price($price) { $num_decimals = absint(get_option('woocommerce_price_num_decimals')); $currency_symbo... Add solution -
Python 2021-10-09 14:19:04
ID number zero python
>>> f'{5:04}' '0005' >>> f'{5:04}' '0005' #This uses the string formatting minilanguage: >>> five = 5 >>> f'{five:04}' '0005' #The first zero means the fill, the 4 means to which width: >>> minimum_width = 4... Add solution -
PHP 2021-10-09 03:53:07
oprn nested table on click on table rows
/* Formatting function for row details - modify as you need */ function format ( d ) { // `d` is the original data object for the row return '<table cellpadding="5" cellspacing="0" bor... Add solution -
Python 2021-10-08 05:13:03
trends in yearly data python
import matplotlib.pyplot as pltimport matplotlib.dates as mdatesfig, ax = plt.subplots()ax.grid(True)year = mdates.YearLocator(month=1)month = mdates.MonthLocator(interval=3)year_format = mdates.DateFormatter('%Y')month_format = mdates.DateFormatter('%m')... Add solution -
Other 2021-10-07 19:46:09
nginx access log format
log_format main 'site="$server_name" server="$host" dest_port="$server_port" dest_ip="$server_addr" ' 'src="$remote_addr" src_ip="$realip_remote_addr" user="$remote_user&q... Add solution -
Other 2021-10-07 11:43:05
input formatting
1/* Test Formatting Input (TestFormattedInput.cpp) */ #include <iostream> #include <iomanip> #include <string> using namespace std; int main() { string areaCode, phoneCode; string inStr; cout << "Enter your phone ... Add solution